diff --git a/tests/test_compat.py b/tests/test_compat.py new file mode 100644 index 0000000..1b88449 --- /dev/null +++ b/tests/test_compat.py @@ -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"), {})