Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
abidlabs committed Oct 23, 2024
1 parent d83a115 commit c98fcb1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,12 @@ async def test_domain_whitelist():

with pytest.raises(ValueError, match=FAILED_VALIDATION_ERR_MESSAGE):
await safehttpx.get("http://192.168.1.250.nip.io", domain_whitelist=["huggingface.co"])

@pytest.mark.asyncio
async def test_transport_false():
try:
await safehttpx.get("http://192.168.1.250.nip.io", _transport=False)
except ValueError as e:
assert FAILED_VALIDATION_ERR_MESSAGE not in str(e)
except Exception:
pass # Other exeptions (e.g. connection timeouts) are fine

0 comments on commit c98fcb1

Please sign in to comment.