Skip to content

Commit

Permalink
fix: use query params in count request (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdstein authored Mar 20, 2024
1 parent de863a2 commit 1c6c1b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/posit/connect/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ def delete(self) -> None:
raise NotImplementedError()

def count(self) -> int:
response: requests.Response = self.session.get(self.url, json={"page_size": 1})
response: requests.Response = self.session.get(
self.url, params={"page_size": 1}
)
print(response.json())
result: dict = response.json()
return result["total"]
2 changes: 1 addition & 1 deletion tests/posit/connect/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def test_count(self):
responses.get(
"https://connect.example/__api__/v1/users",
json=load_mock("v1/users.json"),
match=[responses.matchers.json_params_matcher({"page_size": 1})],
match=[responses.matchers.query_param_matcher({"page_size": 1})],
)
con = Client(api_key="12345", url="https://connect.example/")
count = con.users.count()
Expand Down

0 comments on commit 1c6c1b2

Please sign in to comment.