Skip to content
Merged
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
14 changes: 12 additions & 2 deletions tests/unit/neptune_api/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
)
def test_error_while_parsing_200_response(endpoint_module, kwargs, content):
httpx_client = Mock()
httpx_client.request.return_value = httpx.Response(status_code=HTTPStatus(200), content=content, headers={})
httpx_client.request.return_value = httpx.Response(
request=httpx.Request("GET", "https://example.com/api/projects/some/project"),
status_code=HTTPStatus(200),
content=content,
headers={},
)

client = Mock()
client.get_httpx_client = Mock(return_value=httpx_client)
Expand All @@ -50,7 +55,12 @@ def test_error_while_parsing_200_response(endpoint_module, kwargs, content):
def test_error_while_parsing_400_response(endpoint_module, kwargs, content):
"""Test errors in parsing error responses, specifically 400 Bad Request -> the Error model."""
httpx_client = Mock()
httpx_client.request.return_value = httpx.Response(status_code=HTTPStatus(400), content=content, headers={})
httpx_client.request.return_value = httpx.Response(
request=httpx.Request("GET", "https://example.com/api/projects/some/project"),
status_code=HTTPStatus(400),
content=content,
headers={},
)

client = Mock()
client.get_httpx_client = Mock(return_value=httpx_client)
Expand Down
Loading