Skip to content

Commit

Permalink
fixup! test(unittest): Rewrite unittests to meet new requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
MortalHappiness committed Oct 25, 2023
1 parent adf165b commit b2e6d5c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test__default(self, temp_git_folder):
assert not (p / 'folder1' / 'empty_folder' / '__init__.py').exists()
assert not (p / 'folder3' / '__init__.py').exists()
assert not (
p / 'folder1' / 'folder_containing_only_ignored_files' / '__init__.py'
p / 'folder1' / 'folder_containing_only_ignored_files' / '__init__.py'
).exists()
assert (p / 'folder1' / '__init__.py').is_file()
assert (p / 'folder1' / 'folder1_1' / 'folder1_1_1' / '__init__.py').is_file()
Expand All @@ -187,12 +187,20 @@ def test__exclude(self, temp_git_folder):
assert not (p / 'folder1' / 'empty_folder' / '__init__.py').exists()
assert not (p / 'folder3' / '__init__.py').exists()
assert not (
p / 'folder1' / 'folder_containing_only_ignored_files' / '__init__.py'
p / 'folder1' / 'folder_containing_only_ignored_files' / '__init__.py'
).exists()
assert not (
p / 'folder1' / 'folder1_1' / 'folder1_1_1' / '__init__.py'
p / 'folder1' / 'folder1_1' / 'folder1_1_1' / '__init__.py'
).exists()
assert (p / 'folder1' / '__init__.py').is_file()
assert (p / 'folder1' / 'folder1_2' / '__init__.py').is_file()
assert (p / 'folder2' / 'folder2_2' / '__init__.py').is_file()
assert 0 == Missing(exclude=exclude).run()

def test__non_str_sequence_exclude_throws_typeerror(self, temp_git_folder):
with pytest.raises(TypeError):
Missing(exclude=1)

def test__non_dir_exclude_throws_typeerror(self, temp_git_folder):
with pytest.raises(TypeError):
Missing(exclude=['toplevel.py'])

0 comments on commit b2e6d5c

Please sign in to comment.