diff options
| author | Cody Logan <cody@lokken.dev> | 2023-11-07 11:41:49 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-07 11:41:49 -0800 |
| commit | 5129ad62392948a033ee988e4093d095f5005c77 (patch) | |
| tree | 5df144f6970d7d015bce94cff4516a388b5cddab /tests/test_file_class.py | |
| parent | bc5d19c8150bf7960839243ceeb6f62a9df54e18 (diff) | |
| parent | 7c2dadfa38ac08a060f2df987b7d0b7f2f0b5ad0 (diff) | |
| download | wikiget-5129ad62392948a033ee988e4093d095f5005c77.tar.gz wikiget-5129ad62392948a033ee988e4093d095f5005c77.zip | |
Merge pull request #12 from clpo13/improve-tests
Improve tests and test coverage
Diffstat (limited to 'tests/test_file_class.py')
| -rw-r--r-- | tests/test_file_class.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/test_file_class.py b/tests/test_file_class.py index b935efc..42f5667 100644 --- a/tests/test_file_class.py +++ b/tests/test_file_class.py @@ -22,7 +22,7 @@ from wikiget.file import File class TestFileClass: - @pytest.fixture(scope="class") + @pytest.fixture def file_with_name(self) -> File: """ A File object created with only a name should set its destination property to @@ -39,7 +39,7 @@ class TestFileClass: def test_file_with_name_site(self, file_with_name: File) -> None: assert file_with_name.site == DEFAULT_SITE - @pytest.fixture(scope="class") + @pytest.fixture def file_with_name_and_dest(self) -> File: """ A File object created with a name and destination should set those properties @@ -60,3 +60,12 @@ class TestFileClass: """ file = File("foobar.jpg", site="en.wikipedia.org") assert file.site == "en.wikipedia.org" + + def test_file_equality(self, file_with_name: File) -> None: + assert File(name="foobar.jpg") == file_with_name + + def test_file_inequality(self, file_with_name: File) -> None: + assert File(name="foobaz.jpg", dest="output.jpg") != file_with_name + + def test_file_comparison_with_non_file(self, file_with_name: File) -> None: + assert file_with_name.__eq__({"name": "foobar.jpg"}) == NotImplemented |
