diff options
| author | Cody Logan <cody@lokken.dev> | 2023-11-01 11:55:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-01 11:55:44 -0700 |
| commit | 15ffefbd0ca80f240b5468b4ab5cea5e9800ad83 (patch) | |
| tree | c0b5bd30f23183cd81f67622c3534e0ee5417bee /tests/test_file_class.py | |
| parent | e11e6ec4fc6180f2ffc4905b2561ecc385a29e5d (diff) | |
| parent | 823171ba0bf42766446509f0143b95078285a1f0 (diff) | |
| download | wikiget-15ffefbd0ca80f240b5468b4ab5cea5e9800ad83.tar.gz wikiget-15ffefbd0ca80f240b5468b4ab5cea5e9800ad83.zip | |
Merge pull request #11 from clpo13/add-tests
Add and improve some tests
Diffstat (limited to 'tests/test_file_class.py')
| -rw-r--r-- | tests/test_file_class.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_file_class.py b/tests/test_file_class.py index 1b76566..b935efc 100644 --- a/tests/test_file_class.py +++ b/tests/test_file_class.py @@ -24,6 +24,10 @@ from wikiget.file import File class TestFileClass: @pytest.fixture(scope="class") def file_with_name(self) -> File: + """ + A File object created with only a name should set its destination property to + the same value and its site property to the program's default site. + """ return File("foobar.jpg") def test_file_with_name(self, file_with_name: File) -> None: @@ -37,6 +41,10 @@ class TestFileClass: @pytest.fixture(scope="class") def file_with_name_and_dest(self) -> File: + """ + A File object created with a name and destination should set those properties + accordingly; they should not be the same value. + """ return File("foobar.jpg", dest="bazqux.jpg") def test_file_with_name_and_dest(self, file_with_name_and_dest: File) -> None: @@ -46,5 +54,9 @@ class TestFileClass: assert file_with_name_and_dest.dest != file_with_name_and_dest.name def test_file_with_name_and_site(self) -> None: + """ + A File object created with a name and site should set those properties + accordingly and not use the program's default site. + """ file = File("foobar.jpg", site="en.wikipedia.org") assert file.site == "en.wikipedia.org" |
