Skip to content

Commit 9b32187

Browse files
yt-msMidnighter
authored andcommitted
test: make sure httpx.Request.raw_path does what we want.
1 parent 5edc509 commit 9b32187

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/unit/api/test_structurizr_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ def test_archive_workspace(client, mocker):
117117
mocked_handle.write.assert_called_once_with('{"mock_key":"mock_value"}')
118118

119119

120+
def test_httpx_response_raw_path_behaviour():
121+
"""Make sure that `Response.raw_path` continues to do what we need.
122+
123+
As the httpx library is evolving rapidly, this is a defensive test to make sure
124+
that `Response.raw_path` continues to behave as we need for StructurizrClient, in
125+
particular not HTTP-escaping parameters.
126+
"""
127+
request = Request(method="GET", url="http://someserver:8081/some/path?param=a+b")
128+
assert request.url.raw_path.decode("ascii") == "/some/path?param=a+b"
129+
130+
120131
def test_add_headers_authentication(client: StructurizrClient, mocker):
121132
"""Validate the headers are added correctly, including authentication."""
122133
mocker.patch.object(client, "_number_once", return_value="1529225966174")

0 commit comments

Comments
 (0)