def test_json(): resp = yaar.Response(200, yaar.json.dumps({'some': 'json'}).encode()) assert resp.json()
async def req(method, url, **kw): nonlocal REQ_TYPE REQ_TYPE = method return yaar.Response(200, b'some text')
def test_response(): resp = yaar.Response(200, b'some text') assert resp.text == 'some text'