Skip to content

Commit

Permalink
update posix and windows paths tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andreacosolo committed Sep 28, 2022
1 parent 7a4080d commit fb7e00b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ AllItems.xls
Custom_scripts/
Data_Files/MicroscopyCalibration/Files/
.pytest_cache/
.python-version
10 changes: 7 additions & 3 deletions tests/test_import_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import wranglertools.import_data as imp
import pytest
import pathlib as pp
# test data is in conftest.py


Expand Down Expand Up @@ -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'

0 comments on commit fb7e00b

Please sign in to comment.