|
9 | 9 |
|
10 | 10 | import pytest |
11 | 11 | from mock import MagicMock, patch |
12 | | -from typing import Union, ClassVar |
| 12 | +from typing import Union |
13 | 13 |
|
14 | 14 | from connect import TierConfigAutomation |
15 | 15 | from connect.models import Param, ActivationTileResponse, ActivationTemplateResponse |
@@ -189,19 +189,25 @@ def test_process_with_activation_template(): |
189 | 189 | automation.process() |
190 | 190 |
|
191 | 191 |
|
192 | | -@patch('requests.get', MagicMock(return_value=_get_response_ok_invalid_product())) |
| 192 | +@patch('requests.get', MagicMock(return_value=_get_response_ok())) |
| 193 | +@patch('requests.post', MagicMock(return_value=_get_response_ok())) |
| 194 | +@patch('requests.put', MagicMock(return_value=_get_response_ok())) |
193 | 195 | def test_process_raise_inquire(): |
194 | 196 | automation = TierConfigAutomationHelper(exception_class=FulfillmentInquire) |
195 | 197 | automation.process() |
196 | 198 |
|
197 | 199 |
|
198 | | -@patch('requests.get', MagicMock(return_value=_get_response_ok_invalid_product())) |
| 200 | +@patch('requests.get', MagicMock(return_value=_get_response_ok())) |
| 201 | +@patch('requests.post', MagicMock(return_value=_get_response_ok())) |
| 202 | +@patch('requests.put', MagicMock(return_value=_get_response_ok())) |
199 | 203 | def test_process_raise_fail(): |
200 | 204 | automation = TierConfigAutomationHelper(exception_class=FulfillmentFail) |
201 | 205 | automation.process() |
202 | 206 |
|
203 | 207 |
|
204 | | -@patch('requests.get', MagicMock(return_value=_get_response_ok_invalid_product())) |
| 208 | +@patch('requests.get', MagicMock(return_value=_get_response_ok())) |
| 209 | +@patch('requests.post', MagicMock(return_value=_get_response_ok())) |
| 210 | +@patch('requests.put', MagicMock(return_value=_get_response_ok())) |
205 | 211 | def test_process_raise_skip(): |
206 | 212 | automation = TierConfigAutomationHelper(exception_class=Skip) |
207 | 213 | automation.process() |
@@ -230,7 +236,7 @@ def test_get_tier_config_param(): |
230 | 236 |
|
231 | 237 | class TierConfigAutomationHelper(TierConfigAutomation): |
232 | 238 | def __init__(self, response='', exception_class=None): |
233 | | - # type: (Union[ActivationTemplateResponse, ActivationTileResponse, str], ClassVar) -> None |
| 239 | + # type: (Union[ActivationTemplateResponse, ActivationTileResponse, str], type) -> None |
234 | 240 | super(TierConfigAutomationHelper, self).__init__() |
235 | 241 | self.response = response |
236 | 242 | self.exception_class = exception_class |
|
0 commit comments