diff options
| author | Cody Logan <cody@lokken.dev> | 2023-11-01 11:33:13 -0700 |
|---|---|---|
| committer | Cody Logan <cody@lokken.dev> | 2023-11-01 11:42:43 -0700 |
| commit | f61853c366a1554f545b34783e1aa282022598b9 (patch) | |
| tree | c0b5bd30f23183cd81f67622c3534e0ee5417bee /tests/test_client.py | |
| parent | 8b923f0cee8fed90d6eef313429eb593877e0f2d (diff) | |
| download | wikiget-f61853c366a1554f545b34783e1aa282022598b9.tar.gz wikiget-f61853c366a1554f545b34783e1aa282022598b9.zip | |
Add some explanatory comments to tests
Diffstat (limited to 'tests/test_client.py')
| -rw-r--r-- | tests/test_client.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_client.py b/tests/test_client.py index 832bf21..cf6e29c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -31,6 +31,10 @@ class TestQueryApi: def test_connect_to_site( self, mock_site: MagicMock, caplog: pytest.LogCaptureFixture ) -> None: + """ + The connect_to_site function should create a debug log message recording the + name of the site we're connecting to. + """ caplog.set_level(logging.DEBUG) mock_site.return_value = MagicMock() args = construct_parser().parse_args(["File:Example.jpg"]) @@ -40,7 +44,12 @@ class TestQueryApi: @pytest.mark.skip(reason="skip tests that query a live API") def test_query_api(self, caplog: pytest.LogCaptureFixture) -> None: + """ + The query_api function should create a debug log message containing the user + agent we're sending to the API. + """ caplog.set_level(logging.DEBUG) - site = connect_to_site("commons.wikimedia.org", self.args) + args = construct_parser().parse_args(["File:Example.jpg"]) + site = connect_to_site("commons.wikimedia.org", args) _ = query_api("Example.jpg", site) assert USER_AGENT in caplog.text |
