request_test_lib: Add mocking PUT requests.

This commit is contained in:
novokrest 2018-06-11 06:57:36 +03:00 committed by showell
parent f8fd7b6fbf
commit 914583e8f7

View file

@ -79,6 +79,16 @@ def mock_http_conversation(http_data):
['params', 'headers', 'json', 'data'],
meta
)
elif http_method == 'PUT':
with patch('requests.put') as mock_post:
mock_post.return_value = get_response(http_response, http_headers, is_raw_response)
yield
assert_called_with_fields(
mock_post,
http_request,
['params', 'headers', 'json', 'data'],
meta
)
else:
with patch('requests.post') as mock_post:
mock_post.return_value = get_response(http_response, http_headers, is_raw_response)