From ffd14a01cdc0fca2315253eb3c7d4c2ed233b02b Mon Sep 17 00:00:00 2001 From: tdstein Date: Thu, 11 Apr 2024 12:33:23 -0400 Subject: [PATCH] tests: adds query param matcher --- tests/posit/connect/test_visits.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/posit/connect/test_visits.py b/tests/posit/connect/test_visits.py index 932c4b9c..c6a11a1e 100644 --- a/tests/posit/connect/test_visits.py +++ b/tests/posit/connect/test_visits.py @@ -1,5 +1,7 @@ import responses +from responses import matchers + from posit.connect import Client from posit.connect.visits import Visit, rename_params @@ -46,11 +48,26 @@ def test(self): mock_get = responses.get( f"https://connect.example/__api__/v1/instrumentation/content/visits", json=load_mock("v1/instrumentation/content/visits.json"), + match=[ + matchers.query_param_matcher( + { + "limit": 500, + } + ) + ], ) mock_get_sentinel = responses.get( f"https://connect.example/__api__/v1/instrumentation/content/visits", json={"paging": {}, "results": []}, + match=[ + matchers.query_param_matcher( + { + "next": "23948901087", + "limit": 500, + } + ) + ], ) # setup @@ -72,6 +89,13 @@ def test(self): mock_get = responses.get( f"https://connect.example/__api__/v1/instrumentation/content/visits", json=load_mock("v1/instrumentation/content/visits.json"), + match=[ + matchers.query_param_matcher( + { + "limit": 500, + } + ) + ], ) # setup