Skip to content

Commit

Permalink
tests: adds query param matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
tdstein committed Apr 11, 2024
1 parent 420b418 commit ffd14a0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/posit/connect/test_visits.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import responses

from responses import matchers

from posit.connect import Client
from posit.connect.visits import Visit, rename_params

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ffd14a0

Please sign in to comment.