diff --git a/src/client/test/test_utils.py b/src/client/test/test_utils.py index 20144c6..d09c8df 100644 --- a/src/client/test/test_utils.py +++ b/src/client/test/test_utils.py @@ -1,4 +1,5 @@ import sys + sys.path.append("../") from dcp_client.utils import utils @@ -15,11 +16,22 @@ def test_get_path_name(): assert utils.get_path_name(filepath)== 'something.txt' def test_get_path_parent(): - filepath = '/here/we/are/testing/something.txt' - assert utils.get_path_parent(filepath)== '/here/we/are/testing' + if sys.platform == 'win32' or sys.platform == 'cygwin': + filepath = '\\here\\we\\are\\testing\\something.txt' + assert utils.get_path_parent(filepath)== '\\here\\we\\are\\testing' + else: + filepath = '/here/we/are/testing/something.txt' + assert utils.get_path_parent(filepath)== '/here/we/are/testing' def test_join_path(): - filepath = '/here/we/are/testing/something.txt' - path1 = '/here/we/are/testing' - path2 = 'something.txt' - assert utils.join_path(path1, path2) == filepath \ No newline at end of file + if sys.platform == 'win32' or sys.platform == 'cygwin': + filepath = '\\here\\we\\are\\testing\\something.txt' + path1 = '\\here\\we\\are\\testing' + path2 = 'something.txt' + else: + filepath = '/here/we/are/testing/something.txt' + path1 = '/here/we/are/testing' + path2 = 'something.txt' + assert utils.join_path(path1, path2) == filepath + +