Skip to content

Commit

Permalink
test: add test for no matching files.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMummery committed Jan 8, 2024
1 parent cd1d40c commit 7729a1b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_integration_rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,18 @@ def test_no_files(tmp_path: Path, cwd, mocker: MockerFixture):
# WHEN
with cwd(tmp_path):
main()

@staticmethod
def test_no_matching_files(tmp_path: Path, cwd, mocker: MockerFixture):
# GIVEN
mocker.patch("sys.argv", ["stub_name", "rename", "input", "output"])
for file in (files := ["file_1", "file_2"]):
(tmp_path / file).write_text("")

# WHEN
with cwd(tmp_path):
main()

# THEN
for file in files:
assert (tmp_path / file).is_file()

0 comments on commit 7729a1b

Please sign in to comment.