From c8601bdc353d13ffaf0a9b7ce996fcd62aeb8b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= <323546+fguillot@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:36:50 -0700 Subject: [PATCH] test(client): fix incorrect mock in test_api_key_auth Mock response.text instead of response.json since export() returns response.text, and assert the return value to actually verify it. --- tests/test_client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 39b11e2..5ae21f3 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1154,13 +1154,15 @@ def test_api_key_auth(self): response = mock.Mock() response.status_code = 200 - response.json.return_value = {} + response.text = "OPML feed" session.get = mock.Mock() session.get.return_value = response client = miniflux.Client("http://localhost", api_key="secret", session=session) - client.export() + result = client.export() + + self.assertEqual(result, "OPML feed") session.get.assert_called_once_with( "http://localhost/v1/export",