aboutsummaryrefslogtreecommitdiff
path: root/tests/test_client.py
diff options
context:
space:
mode:
authorCody Logan <cody@lokken.dev>2023-11-01 11:33:13 -0700
committerCody Logan <cody@lokken.dev>2023-11-01 11:42:43 -0700
commitf61853c366a1554f545b34783e1aa282022598b9 (patch)
treec0b5bd30f23183cd81f67622c3534e0ee5417bee /tests/test_client.py
parent8b923f0cee8fed90d6eef313429eb593877e0f2d (diff)
downloadwikiget-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.py11
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