Skip to content

Commit d67a232

Browse files
committed
Add more tests on module utils.paths
1 parent 90d78e0 commit d67a232

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_paths.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def test_no_fullname(self):
4343

4444
dir_path, only_file_name = os.path.split(path)
4545
self.assertTrue(os.path.exists(dir_path))
46+
self.assertIsNotNone(only_file_name)
4647

4748
def test_no_path(self):
4849
"""
@@ -55,6 +56,7 @@ def test_no_path(self):
5556

5657
dir_path, only_file_name = os.path.split(path)
5758
self.assertTrue(os.path.exists(dir_path))
59+
self.assertIsNotNone(only_file_name)
5860

5961
def test_current_path(self):
6062
"""
@@ -67,3 +69,17 @@ def test_current_path(self):
6769

6870
dir_path, only_file_name = os.path.split(path)
6971
self.assertTrue(os.path.exists(dir_path))
72+
self.assertIsNotNone(only_file_name)
73+
74+
def test_path_with_file_name(self):
75+
"""
76+
Test export path with path and file name specified.
77+
"""
78+
path, file_name = get_export_path(self.ss,
79+
'DCOPF',
80+
path='./test_export.csv',
81+
fmt='csv',)
82+
83+
dir_path, only_file_name = os.path.split(path)
84+
self.assertTrue(os.path.exists(dir_path))
85+
self.assertEqual(only_file_name, 'test_export.csv')

0 commit comments

Comments
 (0)