From 5deb07909d8c01c155c8aeefcd551fe43b764524 Mon Sep 17 00:00:00 2001 From: Diederik van der Boor Date: Thu, 26 Apr 2018 16:00:18 +0200 Subject: [PATCH] Added extra test in case Transport.load() becomes async --- tests/test_asyncio_transport.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_asyncio_transport.py b/tests/test_asyncio_transport.py index dbd11398a..ee11b1e9e 100644 --- a/tests/test_asyncio_transport.py +++ b/tests/test_asyncio_transport.py @@ -5,6 +5,7 @@ from pretend import stub from zeep import asyncio, exceptions +from zeep.cache import InMemoryCache @pytest.mark.requests @@ -24,6 +25,19 @@ def test_load(event_loop): assert result == b'x' +@pytest.mark.requests +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' + + @pytest.mark.requests @pytest.mark.asyncio async def test_post(event_loop):