for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from yfrake.client.validators import validate_response
from yfrake.client.exceptions import BadRequestError
import pytest
tests = [
(
{
"endpoint": {
"result": [
{"key": "value"}
],
"error": False
}
},
True
), (
"key": "value",
"news": [
]
{}
False
"result": [],
"error": True
"result": [{}],
)
@pytest.mark.parametrize('arg,result', tests)
async def test_validate_response(arg, result):
if result is False:
with pytest.raises(BadRequestError):
await validate_response(arg)
else: