aboutsummaryrefslogtreecommitdiff
path: root/tests/test_validations.py
diff options
context:
space:
mode:
authorCody Logan <cody@lokken.dev>2023-11-15 10:02:48 -0800
committerGitHub <noreply@github.com>2023-11-15 10:02:48 -0800
commit55a5311ee4da639a65bd60622315f3fff6936c9a (patch)
tree285f960d4a7afe9d27ecca51e86e7f00fb914d22 /tests/test_validations.py
parent96316c8be7bc21617ec5333f87864a0f002ebaa4 (diff)
parentba782d54aa70a1faf6bf6cdcaeb446f7b4c503db (diff)
downloadwikiget-55a5311ee4da639a65bd60622315f3fff6936c9a.tar.gz
wikiget-55a5311ee4da639a65bd60622315f3fff6936c9a.zip
Merge pull request #13 from clpo13/testing-tmp-folder
Change to temp directory when running tests
Diffstat (limited to 'tests/test_validations.py')
-rw-r--r--tests/test_validations.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/test_validations.py b/tests/test_validations.py
index 161d102..aa4fdd0 100644
--- a/tests/test_validations.py
+++ b/tests/test_validations.py
@@ -163,14 +163,11 @@ class TestFileInput:
class TestVerifyHash:
"""Define tests related to wikiget.validations.verify_hash."""
- def test_verify_hash(self, tmp_path: Path) -> None:
- """Confirm that verify_hash returns the proper SHA1 hash."""
- file_name = "testfile"
- file_contents = "foobar"
- file_sha1 = "8843d7f92416211de9ebb963ff4ce28125932878"
+ def test_verify_hash(self, test_file: Path) -> None:
+ """Confirm that verify_hash returns the proper SHA1 hash.
- # create a temporary file with known contents
- tmp_file = tmp_path / file_name
- tmp_file.write_text(file_contents)
+ The test file used here is generated by a fixture in conftest.py.
+ """
+ expected_sha1 = "cd19c009a30ca9b68045415a3a0838e64f3c2443"
- assert verify_hash(str(tmp_file)) == file_sha1
+ assert verify_hash(str(test_file)) == expected_sha1