Skip to content

Commit

Permalink
Added extra test in case Transport.load() becomes async
Browse files Browse the repository at this point in the history
  • Loading branch information
vdboor committed Apr 26, 2018
1 parent 48dbb59 commit 5deb079
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_asyncio_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pretend import stub

from zeep import asyncio, exceptions
from zeep.cache import InMemoryCache


@pytest.mark.requests
Expand All @@ -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):
Expand Down

0 comments on commit 5deb079

Please sign in to comment.