Fix incorrect request call
This commit is contained in:
Родитель
6b55d4f633
Коммит
2d260036f6
|
@ -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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче