diff options
author | 2021-06-22 09:30:44 +0000 | |
---|---|---|
committer | 2021-06-22 09:30:44 +0000 | |
commit | ae38106f6f4792ad807cf3c04ae8aab758554ff9 (patch) | |
tree | a90b90d12815c47f2201ea583161d3816189b34c /components/pm-subscription-handler/tests/test_subscription.py | |
parent | 1ac9847eb66a074b5413264c788152f7c3ffc28d (diff) |
Revert "[PMSH] Update filter"
This reverts commit 1ac9847eb66a074b5413264c788152f7c3ffc28d.
Reason for revert: Premature merge
Issue-ID: DCAEGEN2-2531
Change-Id: I7f1f236b860105b3d7b0db10bcc5b908c236db1f
Signed-off-by: egernug <gerard.nugent@est.tech>
Diffstat (limited to 'components/pm-subscription-handler/tests/test_subscription.py')
-rwxr-xr-x | components/pm-subscription-handler/tests/test_subscription.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/components/pm-subscription-handler/tests/test_subscription.py b/components/pm-subscription-handler/tests/test_subscription.py index 16c9e509..b18f41e8 100755 --- a/components/pm-subscription-handler/tests/test_subscription.py +++ b/components/pm-subscription-handler/tests/test_subscription.py @@ -19,7 +19,6 @@ import json import os from unittest.mock import patch, Mock -from pmsh_service.mod.network_function import NetworkFunctionFilter from requests import Session import mod.aai_client as aai_client @@ -44,9 +43,6 @@ class SubscriptionTest(BaseClassSetup): mock_session_put.return_value.text = self.aai_response_data with open(os.path.join(os.path.dirname(__file__), 'data/aai_model_info.json'), 'r') as data: self.aai_model_data = data.read() - with open(os.path.join(os.path.dirname(__file__), 'data/cbs_data_1.json'), 'r') as data: - self.cbs_data = json.load(data) - self.nfFilter = NetworkFunctionFilter(**self.cbs_data['config']['pmsh_policy']['subscription']['nfFilter']) mock_session_get.return_value.status_code = 200 mock_session_get.return_value.text = self.aai_model_data self.mock_mr_sub = Mock() @@ -160,23 +156,3 @@ class SubscriptionTest(BaseClassSetup): self.assertEqual(3, len(nfs)) self.assertIsInstance(nfs[0], NetworkFunction) - - def test_filter_diff_with_difference(self): - print(self.nfFilter) - networkFunction = '{"nfNames":["^pnf.*","^vnf.*"],"modelInvariantIDs": ["Extra Data"],"modelVersionIDs": ["Extra Data"],"modelNames": ["Extra Data""]}' - self.assertTrue(self.app_conf.subscription._filter_diff(networkFunction)); - - def test_filter_diff_without_difference(self): - networkFunction = '{"nfNames":["^pnf.*","^vnf.*"],"modelInvariantIDs": [],"modelVersionIDs": [],"modelNames": []}' - self.assertTrue(self.app_conf.subscription._filter_diff(networkFunction)); - self.assertIsNotNone(self.app_conf.subscription) - - def test_update_subscription_filter(self): - original_filter = self.app_conf.subscription.nfFilter - self.app_conf.subscription.nfFilter = '{"nfNames":["^pnf.*","^vnf.*"],"modelInvariantIDs": ["Extra Data"],"modelVersionIDs": ["Extra Data"],"modelNames": ["Extra Data""]}' - self.app_conf.subscription.update_subscription_filter() - updated_subscription = (self.app_conf.subscription.get()) - self.assertTrue(updated_subscription.nfFilter == self.app_conf.subscription.nfFilter) - self.assertFalse(updated_subscription == original_filter) - print(self.app_conf.subscription.get_network_functions()) - |