Make broken test as xfail

This commit is contained in:
Hugo Osvaldo Barrera 2023-05-09 11:52:15 +02:00
parent c55b969791
commit c1d3efb6b8

View file

@ -27,23 +27,27 @@ def test_get_storage_init_args():
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_request_ssl(): async def test_request_ssl():
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
with pytest.raises(aiohttp.ClientConnectorCertificateError) as excinfo: with pytest.raises(
aiohttp.ClientConnectorCertificateError,
match="certificate verify failed",
):
await http.request( await http.request(
"GET", "GET",
"https://self-signed.badssl.com/", "https://self-signed.badssl.com/",
session=session, session=session,
) )
assert "certificate verify failed" in str(excinfo.value)
# XXX FIXME
with pytest.raises(Exception): @pytest.mark.xfail(reason="feature not implemented")
await http.request( @pytest.mark.asyncio
"GET", async def test_request_unsafe_ssl():
"https://self-signed.badssl.com/", async with aiohttp.ClientSession() as session:
verify=False, await http.request(
session=session, "GET",
) "https://self-signed.badssl.com/",
verify=False,
session=session,
)
def fingerprint_of_cert(cert, hash=hashes.SHA256) -> str: def fingerprint_of_cert(cert, hash=hashes.SHA256) -> str: