diff --git a/setup.cfg b/setup.cfg index 1f5a49a2..a7962e27 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ keywords = zip_safe = True install_requires = depinfo - httpx + httpx ~= 0.16 importlib_metadata; python_version <'3.8' ordered-set pydantic diff --git a/tests/unit/api/test_structurizr_client.py b/tests/unit/api/test_structurizr_client.py index 30f4abb9..52db1171 100644 --- a/tests/unit/api/test_structurizr_client.py +++ b/tests/unit/api/test_structurizr_client.py @@ -23,7 +23,7 @@ from typing import List import pytest -from httpx import Request, Response +from httpx import URL, Request, Response from pytest_mock import MockerFixture from structurizr.api.structurizr_client import StructurizrClient @@ -122,10 +122,10 @@ def test_httpx_response_raw_path_behaviour(): 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. + particular not HTTP-escaping parameters, but still ASCII-encoding the URL. """ - 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" + url = URL("http://example.com:8080/api/test?q=motörhead") + assert url.raw_path.decode("ascii") == "/api/test?q=mot%C3%B6rhead" def test_add_headers_authentication(client: StructurizrClient, mocker):