diff options
author | efiacor <fiachra.corcoran@est.tech> | 2020-10-13 11:41:41 +0100 |
---|---|---|
committer | Fiachra Corcoran <fiachra.corcoran@est.tech> | 2020-10-14 09:30:02 +0000 |
commit | 75c997686e5f85709b8c2bfc3f46d9661710a9f8 (patch) | |
tree | 3cb4ff54cb47deda7cb75101c09069d6acf64f94 /components/pm-subscription-handler/tests/test_network_function.py | |
parent | 5d9a6fc623fd8f5147f3df7d42947f97a95ded53 (diff) |
[PMSH] Bug fix for missing sdnc params in DELETE event
Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Change-Id: I051cf6fd727ad99451c3c8386f604501b2eef8e0
Issue-ID: DCAEGEN2-2483
Diffstat (limited to 'components/pm-subscription-handler/tests/test_network_function.py')
-rwxr-xr-x | components/pm-subscription-handler/tests/test_network_function.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/components/pm-subscription-handler/tests/test_network_function.py b/components/pm-subscription-handler/tests/test_network_function.py index f79ec93d..ea5d2c7e 100755 --- a/components/pm-subscription-handler/tests/test_network_function.py +++ b/components/pm-subscription-handler/tests/test_network_function.py @@ -17,7 +17,7 @@ # ============LICENSE_END===================================================== import json import os -from unittest.mock import patch +from unittest.mock import patch, Mock from mod.network_function import NetworkFunction from tests.base_setup import BaseClassSetup @@ -31,12 +31,14 @@ class NetworkFunctionTests(BaseClassSetup): def setUp(self): super().setUp() - self.nf_1 = NetworkFunction(nf_name='pnf_1', - model_invariant_id='some-id', - model_version_id='some-id') - self.nf_2 = NetworkFunction(nf_name='pnf_2', - model_invariant_id='some-id', - model_version_id='some-id') + self.nf_1 = NetworkFunction(sdnc_model_name='blah', sdnc_model_version=1.0, + **{'nf_name': 'pnf_1', + 'model_invariant_id': 'some_id', + 'model_version_id': 'some_other_id'}) + self.nf_2 = NetworkFunction(sdnc_model_name='blah', sdnc_model_version=2.0, + **{'nf_name': 'pnf_2', + 'model_invariant_id': 'some_id', + 'model_version_id': 'some_other_id'}) with open(os.path.join(os.path.dirname(__file__), 'data/aai_model_info.json'), 'r') as data: self.good_model_info = json.loads(data.read()) with open(os.path.join(os.path.dirname(__file__), @@ -75,9 +77,8 @@ class NetworkFunctionTests(BaseClassSetup): self.assertEqual(nf, same_nf) def test_delete_network_function(self): - sub = self.app_conf.subscription for nf in [self.nf_1, self.nf_2]: - sub.add_network_function_to_subscription(nf, self.app_conf.subscription.get()) + self.app_conf.subscription.add_network_function_to_subscription(nf, Mock()) nfs = NetworkFunction.get_all() self.assertEqual(2, len(nfs)) NetworkFunction.delete(nf_name=self.nf_1.nf_name) |