async def test_invalid_public_key(): auth = SimpleAuthenticator() auth.public_key_value = 'whatever' auth._now_unix = lambda: TS with pytest.raises(FailedInboundAuthentication) as excinfo: await auth.authenticate_platform(PLATFORM, TIMESTAMP, VALID_SIGNATURE) assert excinfo.value.args[0] == 'RSA key format is not supported'