diff options
Diffstat (limited to 'components/pm-subscription-handler/tests/test_subscription_handler.py')
-rw-r--r-- | components/pm-subscription-handler/tests/test_subscription_handler.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/components/pm-subscription-handler/tests/test_subscription_handler.py b/components/pm-subscription-handler/tests/test_subscription_handler.py index 31dd0943..2293ee50 100644 --- a/components/pm-subscription-handler/tests/test_subscription_handler.py +++ b/components/pm-subscription-handler/tests/test_subscription_handler.py @@ -162,3 +162,21 @@ class SubscriptionHandlerTest(BaseClassSetup): self.app_conf) sub_handler.execute() mock_nf_del.assert_called_once() + + @patch('mod.pmsh_utils.AppConfig._get_pmsh_config', + MagicMock(return_value=get_pmsh_config('data/cbs_invalid_data.json'))) + @patch('mod.subscription_handler.SubscriptionHandler._check_state_change') + def test_execute_invalid_schema(self, mock_change_state_check): + sub_handler = SubscriptionHandler(self.mock_mr_pub, self.mock_mr_sub, self.app, + self.app_conf) + sub_handler.execute() + mock_change_state_check.assert_not_called() + + @patch('mod.pmsh_utils.AppConfig._get_pmsh_config', + MagicMock(return_value=get_pmsh_config())) + @patch('mod.subscription_handler.SubscriptionHandler._check_state_change') + def test_execute_valid_schema(self, mock_change_state_check): + sub_handler = SubscriptionHandler(self.mock_mr_pub, self.mock_mr_sub, self.app, + self.app_conf) + sub_handler.execute() + mock_change_state_check.assert_called_once() |