bot testing: Allow mocking PATCH HTTP requests.

This commit is contained in:
Alena Volkova 2018-03-02 18:27:10 -05:00 committed by showell
parent 243f7bbe5d
commit 6c0151ab67

View file

@ -62,6 +62,15 @@ def mock_http_conversation(http_data):
http_request,
['params', 'headers']
)
elif http_method == 'PATCH':
with patch('requests.patch') as mock_patch:
mock_patch.return_value = get_response(http_response, http_headers)
yield
assert_called_with_fields(
mock_patch,
http_request,
['params', 'headers', 'json', 'data']
)
else:
with patch('requests.post') as mock_post:
mock_post.return_value = get_response(http_response, http_headers)