Skip to content

Commit 59ec98d

Browse files
fileutils: add testcases for module variables
to avoid future regressions Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
1 parent 78751e0 commit 59ec98d

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

tests/test_fileutils.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,3 +999,59 @@ def test_parent_directory_on_path_and_location_10(self):
999999
result = fileutils.parent_directory((os.path.join(test_dir, test_file)))
10001000
result = fileutils.as_posixpath(result)
10011001
assert result.endswith(expected_name)
1002+
1003+
class TestFileUtilsBase(FileBasedTesting):
1004+
1005+
def test_PATH_TYPE(self):
1006+
try:
1007+
from commoncode.fileutils import PATH_TYPE
1008+
except ImportError:
1009+
self.fail("Can't import PATH_TYPE")
1010+
1011+
def test_POSIX_PATH_SEP(self):
1012+
try:
1013+
from commoncode.fileutils import POSIX_PATH_SEP
1014+
except ImportError:
1015+
self.fail("Can't import POSIX_PATH_SEP")
1016+
1017+
def test_WIN_PATH_SEP(self):
1018+
try:
1019+
from commoncode.fileutils import WIN_PATH_SEP
1020+
except ImportError:
1021+
self.fail("Can't import WIN_PATH_SEP")
1022+
1023+
def test_EMPTY_STRING(self):
1024+
try:
1025+
from commoncode.fileutils import EMPTY_STRING
1026+
except ImportError:
1027+
self.fail("Can't import EMPTY_STRING")
1028+
1029+
def test_DOT(self):
1030+
try:
1031+
from commoncode.fileutils import DOT
1032+
except ImportError:
1033+
self.fail("Can't import DOT")
1034+
1035+
def test_DOT(self):
1036+
try:
1037+
from commoncode.fileutils import DOT
1038+
except ImportError:
1039+
self.fail("Can't import DOT")
1040+
1041+
def test_PATH_SEP(self):
1042+
try:
1043+
from commoncode.fileutils import PATH_SEP
1044+
except ImportError:
1045+
self.fail("Can't import PATH_SEP")
1046+
1047+
def test_PATH_ENV_VAR(self):
1048+
try:
1049+
from commoncode.fileutils import PATH_ENV_VAR
1050+
except ImportError:
1051+
self.fail("Can't import PATH_ENV_VAR")
1052+
1053+
def test_PATH_ENV_SEP(self):
1054+
try:
1055+
from commoncode.fileutils import PATH_ENV_SEP
1056+
except ImportError:
1057+
self.fail("Can't import PATH_ENV_SEP")

0 commit comments

Comments
 (0)