This commit is contained in:
Laurent Mazuel 2018-02-27 16:25:33 -08:00
Родитель 6b55d4f633
Коммит 2d260036f6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 8A1A37C887DC49D8
2 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -82,8 +82,8 @@ class AsyncServiceClientMixin:
session.request,
request.method,
request.url,
request.data,
request.headers,
data=request.data,
headers=request.headers,
**kwargs
)
)
@ -104,8 +104,8 @@ class AsyncServiceClientMixin:
session.request,
request.method,
request.url,
request.data,
request.headers,
data=request.data,
headers=request.headers,
**kwargs
)
)

Просмотреть файл

@ -65,12 +65,12 @@ class TestServiceClient(object):
await ServiceClient.async_send(mock_client, request)
session.request.call_count = 0
mock_client._configure_session.assert_called_with(session)
session.request.assert_called_with('GET', None, [], {}, stream=True)
session.request.assert_called_with('GET', None, data=[], headers={}, stream=True)
session.close.assert_called_with()
await ServiceClient.async_send(mock_client, request, headers={'id':'1234'}, content={'Test':'Data'})
mock_client._configure_session.assert_called_with(session)
session.request.assert_called_with('GET', None, '{"Test": "Data"}', {'Content-Length': '16', 'id':'1234'}, stream=True)
session.request.assert_called_with('GET', None, data='{"Test": "Data"}', headers={'Content-Length': '16', 'id':'1234'}, stream=True)
assert session.request.call_count == 1
session.request.call_count = 0
session.close.assert_called_with()
@ -79,7 +79,7 @@ class TestServiceClient(object):
with pytest.raises(ClientRequestError):
await ServiceClient.async_send(mock_client, request, headers={'id':'1234'}, content={'Test':'Data'}, test='value')
mock_client._configure_session.assert_called_with(session, test='value')
session.request.assert_called_with('GET', None, '{"Test": "Data"}', {'Content-Length': '16', 'id':'1234'}, stream=True)
session.request.assert_called_with('GET', None, data='{"Test": "Data"}', headers={'Content-Length': '16', 'id':'1234'}, stream=True)
assert session.request.call_count == 1
session.request.call_count = 0
session.close.assert_called_with()