diff options
author | 2020-06-19 13:09:44 +0100 | |
---|---|---|
committer | 2020-06-30 02:15:21 +0100 | |
commit | b80449b81a2deb3b6e2510a655de02f9375ef636 (patch) | |
tree | ee022a88ee287645c72f6716eb9c501b9cf06484 /components/pm-subscription-handler/tests/test_policy_response_handler.py | |
parent | 20637908b156aeff53d7607f88d655d0becc1f11 (diff) |
[PMSH] Improve Failure Handling
Signed-off-by: ERIMROB <robertas.rimkus@est.tech>
Change-Id: I15d338321957a293e9f444a10cf3bb06f4212f3e
Issue-ID: DCAEGEN2-2157
Diffstat (limited to 'components/pm-subscription-handler/tests/test_policy_response_handler.py')
-rw-r--r-- | components/pm-subscription-handler/tests/test_policy_response_handler.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/components/pm-subscription-handler/tests/test_policy_response_handler.py b/components/pm-subscription-handler/tests/test_policy_response_handler.py index 582f0bc8..9dd73ee0 100644 --- a/components/pm-subscription-handler/tests/test_policy_response_handler.py +++ b/components/pm-subscription-handler/tests/test_policy_response_handler.py @@ -20,8 +20,6 @@ import os from unittest import TestCase from unittest.mock import patch -from tenacity import stop_after_attempt - from mod.api.db_models import SubscriptionModel from mod.network_function import NetworkFunction from mod.pmsh_utils import AppConfig @@ -128,11 +126,11 @@ class PolicyResponseHandlerTest(TestCase): mock_handle_response.assert_not_called() + @patch('mod.logger.error') @patch('mod.subscription.Subscription.get') - def test_poll_policy_topic_exception(self, mock_get_sub): + def test_poll_policy_topic_exception(self, mock_get_sub, mock_logger): self.mock_policy_mr_sub.get_from_topic.return_value = 'wrong_return' mock_get_sub.return_value = SubscriptionModel(subscription_name='ExtraPM-All-gNB-R2B', status=AdministrativeState.UNLOCKED.value) - self.policy_response_handler.poll_policy_topic.retry.stop = stop_after_attempt(1) - - self.assertRaises(Exception, self.policy_response_handler.poll_policy_topic) + self.policy_response_handler.poll_policy_topic() + mock_logger.assert_called() |