Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Commit

Permalink
test: make sure httpx.Request.raw_path does what we want.
Browse files Browse the repository at this point in the history
  • Loading branch information
yt-ms authored and Midnighter committed Oct 19, 2020
1 parent 5edc509 commit 9b32187
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/unit/api/test_structurizr_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ def test_archive_workspace(client, mocker):
mocked_handle.write.assert_called_once_with('{"mock_key":"mock_value"}')


def test_httpx_response_raw_path_behaviour():
"""Make sure that `Response.raw_path` continues to do what we need.
As the httpx library is evolving rapidly, this is a defensive test to make sure
that `Response.raw_path` continues to behave as we need for StructurizrClient, in
particular not HTTP-escaping parameters.
"""
request = Request(method="GET", url="http://someserver:8081/some/path?param=a+b")
assert request.url.raw_path.decode("ascii") == "/some/path?param=a+b"


def test_add_headers_authentication(client: StructurizrClient, mocker):
"""Validate the headers are added correctly, including authentication."""
mocker.patch.object(client, "_number_once", return_value="1529225966174")
Expand Down

0 comments on commit 9b32187

Please sign in to comment.