Skip to content

Commit e17a83d

Browse files
yt-msMidnighter
authored andcommitted
chore: pin version of httx and also test for encoding of non-ascii chars in URLs
1 parent 9b32187 commit e17a83d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ keywords =
3535
zip_safe = True
3636
install_requires =
3737
depinfo
38-
httpx
38+
httpx ~= 0.16
3939
importlib_metadata; python_version <'3.8'
4040
ordered-set
4141
pydantic

tests/unit/api/test_structurizr_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from typing import List
2424

2525
import pytest
26-
from httpx import Request, Response
26+
from httpx import URL, Request, Response
2727
from pytest_mock import MockerFixture
2828

2929
from structurizr.api.structurizr_client import StructurizrClient
@@ -122,10 +122,10 @@ def test_httpx_response_raw_path_behaviour():
122122
123123
As the httpx library is evolving rapidly, this is a defensive test to make sure
124124
that `Response.raw_path` continues to behave as we need for StructurizrClient, in
125-
particular not HTTP-escaping parameters.
125+
particular not HTTP-escaping parameters, but still ASCII-encoding the URL.
126126
"""
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"
127+
url = URL("http://example.com:8080/api/test?q=motörhead")
128+
assert url.raw_path.decode("ascii") == "/api/test?q=mot%C3%B6rhead"
129129

130130

131131
def test_add_headers_authentication(client: StructurizrClient, mocker):

0 commit comments

Comments
 (0)