From 831fb088d6f902bf5da52a4da7f2d5d731d9f72e Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Mon, 6 Nov 2023 11:34:51 -0800 Subject: Add explanatory comment to query_api test --- tests/test_client.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3