Skip to content

Upgrade httpx library and switch test mocks to match_json #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
]

dependencies = [
"httpx >=0.20.0,<0.28.0",
"httpx>=0.20.0,<0.29.0",
"attrs >=21.3.0",
"python-dateutil >=2.8.0",
"typer[all] <0.10.0",
Expand Down
9 changes: 6 additions & 3 deletions tests/test_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ def test_create_task_with_scope(httpx_mock):
url="https://taskbadger.net/api/org/project/tasks/",
method="POST",
match_headers={"Authorization": "Bearer token"},
match_content=b'{"name": "name", "status": "pending", '
b'"data": {"foo": "bar", "bar": "buzzer"}, '
b'"tags": {"name": "value", "name1": "value1"}}',
match_json={
"name": "name",
"status": "pending",
"data": {"foo": "bar", "bar": "buzzer"},
"tags": {"name": "value", "name1": "value1"},
},
json=_json_task_response(),
status_code=201,
)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_sdk_primatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_create_task(httpx_mock):
url="https://taskbadger.net/api/org/project/tasks/",
method="POST",
match_headers={"Authorization": "Bearer token"},
match_content=b'{"name": "name", "status": "pending"}',
match_json={"name": "name", "status": "pending"},
json=_json_task_response(),
status_code=201,
)
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_update_task(httpx_mock):
url="https://taskbadger.net/api/org/project/tasks/test_id/",
method="PATCH",
match_headers={"Authorization": "Bearer token"},
match_content=json.dumps(expected_body).encode("utf8"),
match_json=expected_body,
json=_json_task_response(),
status_code=200,
)
Expand All @@ -103,7 +103,7 @@ def test_update_task_actions(httpx_mock):
url="https://taskbadger.net/api/org/project/tasks/test_id/",
method="PATCH",
match_headers={"Authorization": "Bearer token"},
match_content=json.dumps(expected_body).encode("utf8"),
match_json=expected_body,
json=_json_task_response(),
status_code=200,
)
Expand Down
Loading