Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mkennard-aquaveo committed Dec 6, 2023
1 parent 432d8e4 commit dfb7476
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions _package/tests/unit_tests/filesystem_pyt.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,17 @@ def test_resolve_relative_path(self):
def test_clear_folder(self):
"""Tests filesystem.clear_folder()."""
# Test using str
d = tempfile.mkdtemp()
temp_file = tempfile.NamedTemporaryFile(mode='wt', dir=d)
assert Path(temp_file.name).is_file()
clear_folder(d)
assert not Path(temp_file.name).is_file()
path = tempfile.mkdtemp()
file_path = _make_bob_file(path)
assert Path(file_path).is_file()
clear_folder(path)
assert not Path(file_path).is_file()

# Test using pathlib
temp_file = tempfile.NamedTemporaryFile(mode='wt', dir=d)
assert Path(temp_file.name).is_file()
clear_folder(Path(d))
assert not Path(temp_file.name).is_file()
file_path = _make_bob_file(path)
assert Path(file_path).is_file()
clear_folder(Path(path))
assert not Path(file_path).is_file()

shutil.rmtree(d)

Expand Down

0 comments on commit dfb7476

Please sign in to comment.