diff options
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) |