Skip to content

Commit

Permalink
test(streaming): test bad URIs/schemes for stream_from_uri
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Aug 21, 2024
1 parent 1762b03 commit 3ad3976
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@
logger = logging.getLogger(__name__)


@pytest.mark.asyncio()
async def test_uri_streaming_bad_uri():
config = c.get_config()
with pytest.raises(se.StreamingBadURI):
await s.stream_from_uri(config, d.get_drs_resolver(config), logger, "http://[.com", None, False)


@pytest.mark.asyncio()
async def test_uri_streaming_bad_scheme():
config = c.get_config()
with pytest.raises(se.StreamingUnsupportedURIScheme):
await s.stream_from_uri(config, d.get_drs_resolver(config), logger, "asdf://example.org", None, False)


@pytest.mark.asyncio()
async def test_http_streaming(aioresponse: aioresponses):
aioresponse.get(HTTP_TEST_URI, body=b"test page")
Expand Down

0 comments on commit 3ad3976

Please sign in to comment.