diff options
| author | Cody Logan <cody@lokken.dev> | 2023-11-03 10:40:07 -0700 |
|---|---|---|
| committer | Cody Logan <cody@lokken.dev> | 2023-11-03 10:40:07 -0700 |
| commit | 08a5907bd8b34e2f99a0c74e6756c66134ceb7d3 (patch) | |
| tree | 62465f3adaae1c9cca0734f79931783407d8d854 /tests/test_validations.py | |
| parent | bc5d19c8150bf7960839243ceeb6f62a9df54e18 (diff) | |
| download | wikiget-08a5907bd8b34e2f99a0c74e6756c66134ceb7d3.tar.gz wikiget-08a5907bd8b34e2f99a0c74e6756c66134ceb7d3.zip | |
Move from unittest.mock to pytest's monkeypatch where feasible
Diffstat (limited to 'tests/test_validations.py')
| -rw-r--r-- | tests/test_validations.py | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/tests/test_validations.py b/tests/test_validations.py index 30e59a3..b3976b6 100644 --- a/tests/test_validations.py +++ b/tests/test_validations.py @@ -26,7 +26,6 @@ from wikiget.validations import valid_file, valid_site, verify_hash class TestSiteInput: @pytest.fixture( - scope="class", params=[ "example.com", "vim.wikia.com", @@ -38,7 +37,6 @@ class TestSiteInput: return valid_site(request.param) @pytest.fixture( - scope="class", params=[ "en.wikipedia.org", "commons.wikimedia.org", @@ -50,20 +48,16 @@ class TestSiteInput: return valid_site(request.param) def test_invalid_site_input(self, invalid_input: None) -> None: - """ - Invalid site strings should not return regex match objects. - """ + """Invalid site strings should not return regex match objects.""" assert invalid_input is None def test_valid_site_input(self, valid_input: Match) -> None: - """ - Valid site strings should return regex match objects. - """ + """Valid site strings should return regex match objects.""" assert valid_input is not None class TestFileRegex: - @pytest.fixture(scope="class") + @pytest.fixture def file_match(self) -> Optional[Match]: """ File regex should return a match object with match groups corresponding @@ -86,7 +80,6 @@ class TestFileRegex: class TestFileInput: @pytest.fixture( - scope="class", params=[ "file:example", "example.jpg", @@ -98,7 +91,6 @@ class TestFileInput: return valid_file(request.param) @pytest.fixture( - scope="class", params=[ "Image:example.jpg", "file:example.jpg", @@ -112,23 +104,17 @@ class TestFileInput: return valid_file(request.param) def test_invalid_file_input(self, invalid_input: None) -> None: - """ - Invalid file strings should not return regex match objects. - """ + """Invalid file strings should not return regex match objects.""" assert invalid_input is None def test_valid_file_input(self, valid_input: Match) -> None: - """ - Valid file strings should return regex match objects. - """ + """Valid file strings should return regex match objects.""" assert valid_input is not None class TestVerifyHash: def test_verify_hash(self, tmp_path: Path) -> None: - """ - Confirm that verify_hash returns the proper SHA1 hash. - """ + """Confirm that verify_hash returns the proper SHA1 hash.""" file_name = "testfile" file_contents = "foobar" file_sha1 = "8843d7f92416211de9ebb963ff4ce28125932878" |
