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
7 changes: 5 additions & 2 deletions tests/test_http_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import responses
from requests import HTTPError, Session

from tests.conftest import DEFAULT_TOKEN
from tests.data.test_defaults import DEFAULT_TOKEN
from todoist_api_python.endpoints import BASE_URL, TASKS_ENDPOINT
from todoist_api_python.http_requests import delete, get, post

Expand Down Expand Up @@ -42,12 +42,15 @@ def test_get_raise_for_status() -> None:
responses.add(
responses.GET,
DEFAULT_URL,
json="<error description>",
status=500,
)

with pytest.raises(HTTPError):
with pytest.raises(HTTPError) as error_info:
get(Session(), DEFAULT_URL, DEFAULT_TOKEN)

assert error_info.value.response.content == b'"<error description>"'


@responses.activate
def test_post_with_data(default_task_response: dict[str, Any]) -> None:
Expand Down