def test_make_call(self):
connection = AsyncConnection(
TEST_USERNAME,
TEST_SECRET,
EMARSYS_URI
)
with aioresponses() as m:
m.get(
urljoin(EMARSYS_URI, 'api/v2/settings'),
status=200,
payload=EMARSYS_SETTINGS_RESPONSE
)
coroutine = connection.make_call('GET', 'api/v2/settings')
loop = asyncio.get_event_loop()
response = loop.run_until_complete(coroutine)
assert response == EMARSYS_SETTINGS_RESPONSE
评论列表
文章目录