summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/tests/test_policy_response_handler.py
diff options
context:
space:
mode:
authorJoseph O'Leary <joseph.o.leary@est.tech>2020-09-10 12:28:23 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-10 12:28:23 +0000
commit2c6ad52e8d0e29b8037776fff035f031558cc4b0 (patch)
tree08b7de937b034a63c883ac9d3da00f6e2e2b381f /components/pm-subscription-handler/tests/test_policy_response_handler.py
parent8265ba613930d3b834d26b0802682c3bef6c2c04 (diff)
parent0080fa4309a40599b7d239b53bab9a74182ae500 (diff)
Merge "[PMSSH] Add sdnc model info to event publish"
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.py31
1 files changed, 16 insertions, 15 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 9dd73ee0..26a06fce 100644
--- a/components/pm-subscription-handler/tests/test_policy_response_handler.py
+++ b/components/pm-subscription-handler/tests/test_policy_response_handler.py
@@ -15,36 +15,37 @@
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=====================================================
-import json
-import os
-from unittest import TestCase
from unittest.mock import patch
from mod.api.db_models import SubscriptionModel
from mod.network_function import NetworkFunction
-from mod.pmsh_utils import AppConfig
from mod.policy_response_handler import PolicyResponseHandler, policy_response_handle_functions
from mod.subscription import AdministrativeState, SubNfState
+from tests.base_setup import BaseClassSetup
-class PolicyResponseHandlerTest(TestCase):
+class PolicyResponseHandlerTest(BaseClassSetup):
+
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
- @patch('mod.pmsh_utils.AppConfig._get_pmsh_config')
@patch('mod.create_app')
- @patch('mod.subscription.Subscription')
@patch('mod.pmsh_utils._MrSub')
- def setUp(self, mock_mr_sub, mock_sub, mock_app, mock_get_app_conf):
- with open(os.path.join(os.path.dirname(__file__), 'data/cbs_data_1.json'), 'r') as data:
- self.cbs_data = json.load(data)
+ def setUp(self, mock_mr_sub, mock_app):
+ super().setUp()
self.mock_policy_mr_sub = mock_mr_sub
- mock_get_app_conf.return_value = self.cbs_data
- self.app_conf = AppConfig()
- self.sub = self.app_conf.subscription
- self.mock_app = mock_app
self.nf = NetworkFunction(nf_name='nf1')
self.policy_response_handler = PolicyResponseHandler(self.mock_policy_mr_sub,
self.app_conf,
- self.mock_app)
+ mock_app)
+
+ def tearDown(self):
+ super().tearDown()
+
+ @classmethod
+ def tearDownClass(cls):
+ super().tearDownClass()
@patch('mod.network_function.NetworkFunction.delete')
def test_handle_response_locked_success(self, mock_delete):