summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/tests/test_pmsh_service.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/pm-subscription-handler/tests/test_pmsh_service.py')
-rw-r--r--components/pm-subscription-handler/tests/test_pmsh_service.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/components/pm-subscription-handler/tests/test_pmsh_service.py b/components/pm-subscription-handler/tests/test_pmsh_service.py
index 4a6032b5..b7225677 100644
--- a/components/pm-subscription-handler/tests/test_pmsh_service.py
+++ b/components/pm-subscription-handler/tests/test_pmsh_service.py
@@ -38,19 +38,22 @@ class PMSHServiceTest(TestCase):
self.mock_sub = mock_sub
self.mock_mr_pub = mock_mr_pub
self.mock_config_handler = mock_config_handler
+ self.mock_aai_sub = mock_sub
self.nf_1 = NetworkFunction(nf_name='pnf_1')
self.nf_2 = NetworkFunction(nf_name='pnf_2')
self.nfs = [self.nf_1, self.nf_2]
@patch('threading.Timer')
@patch('mod.aai_client.get_pmsh_subscription_data')
- def test_subscription_processor_changed_state(self, mock_get_aai, mock_thread):
+ @patch('pmsh_service_main.PeriodicTask')
+ def test_subscription_processor_changed_state(self, periodic_task, mock_get_aai, mock_thread):
self.mock_config_handler.get_config.return_value = self.cbs_data_1
mock_get_aai.return_value = self.mock_sub, self.nfs
mock_thread.start.return_value = 1
+ periodic_task.start.return_value = 1
pmsh_service.subscription_processor(self.mock_config_handler, 'LOCKED',
- self.mock_mr_pub, self.mock_app)
+ self.mock_mr_pub, self.mock_app, self.mock_aai_sub)
self.mock_sub.process_subscription.assert_called_with(self.nfs, self.mock_mr_pub)
@@ -63,7 +66,7 @@ class PMSHServiceTest(TestCase):
mock_thread.start.return_value = 1
pmsh_service.subscription_processor(self.mock_config_handler, 'UNLOCKED', self.mock_mr_pub,
- self.mock_app)
+ self.mock_app, self.mock_aai_sub)
mock_logger.assert_called_with('Administrative State did not change in the Config')
@@ -77,6 +80,6 @@ class PMSHServiceTest(TestCase):
self.mock_sub.process_subscription.side_effect = Exception
pmsh_service.subscription_processor(self.mock_config_handler, 'LOCKED', self.mock_mr_pub,
- self.mock_app)
+ self.mock_app, self.mock_aai_sub)
mock_logger.assert_called_with(f'Error occurred during the '
f'activation/deactivation process ')