diff --git a/.gitignore b/.gitignore index f23e7a61..1b5be302 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ AllItems.xls Custom_scripts/ Data_Files/MicroscopyCalibration/Files/ .pytest_cache/ +.python-version diff --git a/tests/test_import_data.py b/tests/test_import_data.py index 3ab349a8..ac5fba16 100644 --- a/tests/test_import_data.py +++ b/tests/test_import_data.py @@ -1,5 +1,6 @@ import wranglertools.import_data as imp import pytest +import pathlib as pp # test data is in conftest.py @@ -1558,10 +1559,13 @@ def test_get_collections(mock_profiles): assert c.lower() in colls -def test_get_just_filename_unix(): - test_path = '/Files/test/test_file.fastq.gz' +def test_get_just_filename_posix(): + test_path = pp.PurePosixPath('Users', 'username', 'test_dir', 'test_file.fastq.gz') filename = imp.get_just_filename(test_path) assert filename == 'test_file.fastq.gz' -# how to test windows paths?? +def test_get_just_filename_windows(): + test_path = pp.PureWindowsPath('c:/', 'Users', 'username', 'test_dir', 'test_file.fastq.gz') + filename = imp.get_just_filename(test_path) + assert filename == 'test_file.fastq.gz'