aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Logan <cody@lokken.dev>2023-11-06 11:34:51 -0800
committerCody Logan <cody@lokken.dev>2023-11-06 11:34:51 -0800
commit831fb088d6f902bf5da52a4da7f2d5d731d9f72e (patch)
tree2109d2033b95fda9f6a4e560730a4a637fb0f5c7
parent5b3fd4383462503c8d9eaae53692e68b159d5536 (diff)
downloadwikiget-831fb088d6f902bf5da52a4da7f2d5d731d9f72e.tar.gz
wikiget-831fb088d6f902bf5da52a4da7f2d5d731d9f72e.zip
Add explanatory comment to query_api test
-rw-r--r--tests/test_client.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_client.py b/tests/test_client.py
index fd47a35..45739d3 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -109,8 +109,13 @@ class TestQueryApi:
The query_api function should return an Image object when given a name and a
valid Site.
"""
+ # These mock objects represent Site and Image objects that the real program
+ # would have created using the MediaWiki API. The Site.images attribute is
+ # normally populated during Site init, but since we're not doing that, a mock
+ # dict is created for query_api to parse.
mock_site = MagicMock(Site)
mock_image = MagicMock(Image)
mock_site.images = {"Example.jpg": mock_image}
+
image = query_api("Example.jpg", mock_site)
assert image == mock_image