Skip to content

Commit

Permalink
✅ Add test for bytestring URL
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Oct 6, 2023
1 parent 1144818 commit 8e77dfe
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_config_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@ def test_relative_urls_are_made_absolute(method):
assert m.last_request.url == "https://from-factory.example.com/foo"


@given(method=http_methods)
def test_relative_bytestring_urls_are_made_absolute(method):
adapter = TestConfigAdapter()
client = APIClient.configure_from(adapter)

with (
requests_mock.Mocker() as m,
client,
):
m.register_uri(ANY, ANY)

client.request(method, b"foo")

assert len(m.request_history), 1
assert m.last_request.url == "https://from-factory.example.com/foo"


@given(method=http_methods)
def test_absolute_urls_must_match_base_url(method):
adapter = TestConfigAdapter()
Expand Down

0 comments on commit 8e77dfe

Please sign in to comment.