Skip to content

Commit 4576a0a

Browse files
authored
Fix tests/unit/neptune_api/test_endpoints.py (#207)
1 parent 8ddcb33 commit 4576a0a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/unit/neptune_api/test_endpoints.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@
2727
)
2828
def test_error_while_parsing_200_response(endpoint_module, kwargs, content):
2929
httpx_client = Mock()
30-
httpx_client.request.return_value = httpx.Response(status_code=HTTPStatus(200), content=content, headers={})
30+
httpx_client.request.return_value = httpx.Response(
31+
request=httpx.Request("GET", "https://example.com/api/projects/some/project"),
32+
status_code=HTTPStatus(200),
33+
content=content,
34+
headers={},
35+
)
3136

3237
client = Mock()
3338
client.get_httpx_client = Mock(return_value=httpx_client)
@@ -50,7 +55,12 @@ def test_error_while_parsing_200_response(endpoint_module, kwargs, content):
5055
def test_error_while_parsing_400_response(endpoint_module, kwargs, content):
5156
"""Test errors in parsing error responses, specifically 400 Bad Request -> the Error model."""
5257
httpx_client = Mock()
53-
httpx_client.request.return_value = httpx.Response(status_code=HTTPStatus(400), content=content, headers={})
58+
httpx_client.request.return_value = httpx.Response(
59+
request=httpx.Request("GET", "https://example.com/api/projects/some/project"),
60+
status_code=HTTPStatus(400),
61+
content=content,
62+
headers={},
63+
)
5464

5565
client = Mock()
5666
client.get_httpx_client = Mock(return_value=httpx_client)

0 commit comments

Comments
 (0)