Skip to content

Commit

Permalink
Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Aug 6, 2024
1 parent e6635a0 commit c7dfa4e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
test that function in compati behave the same
"""

import pytest

from micropip._compat import HttpStatusError, fetch_string_and_headers


@pytest.mark.asyncio
async def test_404_raise(httpserver):
httpserver.expect_request("/404").respond_with_data(
"Not found", status=404, content_type="text/plain"
)
with pytest.raises(HttpStatusError):
await fetch_string_and_headers(httpserver.url_for("/404"), {})

0 comments on commit c7dfa4e

Please sign in to comment.