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

Commit

Permalink
chore: pin version of httx and also test for encoding of non-ascii ch…
Browse files Browse the repository at this point in the history
…ars in URLs
  • Loading branch information
yt-ms authored and Midnighter committed Oct 19, 2020
1 parent 9b32187 commit e17a83d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ keywords =
zip_safe = True
install_requires =
depinfo
httpx
httpx ~= 0.16
importlib_metadata; python_version <'3.8'
ordered-set
pydantic
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/api/test_structurizr_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit e17a83d

Please sign in to comment.