Skip to content

Commit

Permalink
Check request header in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Dec 20, 2024
1 parent a64b90e commit b68e81d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_key_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def test_url_key_resolver(httpx_mock: HTTPXMock):
res = resolver.resolve_public_key(key_id)
assert res == public_key

request = httpx_mock.get_request()
assert request.headers["Accept"] == "application/x-pem-file"

with pytest.raises(KeyError):
_ = resolver.resolve_public_key("unknown")

Expand All @@ -61,6 +64,9 @@ def test_url_key_resolver_pattern(httpx_mock: HTTPXMock):
res = resolver.resolve_public_key(key_id)
assert res == public_key

request = httpx_mock.get_request()
assert request.headers["Accept"] == "application/x-pem-file"

with pytest.raises(KeyError):
_ = resolver.resolve_public_key("unknown")

Expand Down

0 comments on commit b68e81d

Please sign in to comment.