99
1010import pytest
1111from mock import MagicMock , patch
12+ from typing import Union
1213
1314from connect import TierConfigAutomation
14- from connect .models import Param
15+ from connect .models import Param , ActivationTileResponse , ActivationTemplateResponse
1516from connect .models .base import BaseModel
1617from connect .models .company import Company
1718from connect .models .connection import Connection
@@ -155,7 +156,7 @@ def test_create_resource():
155156
156157
157158@patch ('requests.get' , MagicMock (return_value = _get_response_ok ()))
158- def test_process ():
159+ def test_process_no_result ():
159160 automation = TierConfigAutomationHelper ()
160161 automation .process ()
161162
@@ -173,6 +174,13 @@ def test_process_invalid_product():
173174 automation .process ()
174175
175176
177+ @patch ('requests.get' , MagicMock (return_value = _get_response_ok ()))
178+ @patch ('requests.post' )
179+ def test_process_with_activation_tile (_ ):
180+ automation = TierConfigAutomationHelper (ActivationTileResponse ('TL-000-000-000' ))
181+ automation .process ()
182+
183+
176184@patch ('requests.get' , MagicMock (return_value = _get_response_ok ()))
177185def test_get_tier_config ():
178186 config = TierConfigAutomation ().get_tier_config ('' , '' )
@@ -195,5 +203,10 @@ def test_get_tier_config_param():
195203
196204
197205class TierConfigAutomationHelper (TierConfigAutomation ):
206+ def __init__ (self , response = '' ):
207+ # type: (Union[ActivationTemplateResponse, ActivationTileResponse]) -> None
208+ super (TierConfigAutomationHelper , self ).__init__ ()
209+ self .response = response
210+
198211 def process_request (self , request ):
199- pass
212+ return self . response
0 commit comments