def test_load_cache(event_loop): cache = InMemoryCache() transport = asyncio.AsyncTransport(loop=event_loop, cache=cache) with aioresponses() as m: m.get("http://tests.python-zeep.org/test.xml", body="x") result = transport.load("http://tests.python-zeep.org/test.xml") assert result == b"x" assert cache.get("http://tests.python-zeep.org/test.xml") == b"x"
def test_load_cache(httpx_mock): cache = InMemoryCache() transport = AsyncTransport(cache=cache) httpx_mock.add_response(url="http://tests.python-zeep.org/test.xml", data="x") result = transport.load("http://tests.python-zeep.org/test.xml") assert result == b"x" assert cache.get("http://tests.python-zeep.org/test.xml") == b"x"
def test_load_cache(event_loop): cache = InMemoryCache() transport = asyncio.AsyncTransport(loop=event_loop, cache=cache) with aioresponses() as m: m.get('http://tests.python-zeep.org/test.xml', body='x') result = transport.load('http://tests.python-zeep.org/test.xml') assert result == b'x' assert cache.get('http://tests.python-zeep.org/test.xml') == b'x'