From 914583e8f75b571fec85859c044cdf9284b84e18 Mon Sep 17 00:00:00 2001 From: novokrest Date: Mon, 11 Jun 2018 06:57:36 +0300 Subject: [PATCH] request_test_lib: Add mocking PUT requests. --- zulip_bots/zulip_bots/request_test_lib.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zulip_bots/zulip_bots/request_test_lib.py b/zulip_bots/zulip_bots/request_test_lib.py index 9eb9cee..e9520b0 100644 --- a/zulip_bots/zulip_bots/request_test_lib.py +++ b/zulip_bots/zulip_bots/request_test_lib.py @@ -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)