summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/tests
diff options
context:
space:
mode:
authorERIMROB <robertas.rimkus@est.tech>2020-04-01 17:54:19 +0100
committerERIMROB <robertas.rimkus@est.tech>2020-04-02 12:10:25 +0100
commite97cde0ff09bc602a1ff665f573786c4f5a746ba (patch)
treead7f9d6645903f9431eb8b5fe404dd7ccdc6c4bf /components/pm-subscription-handler/tests
parentc3ab68bdccbff73659ceb1fe196e2d53d141e38f (diff)
[PMSH] Fix bug of deactivation during undeploy1.0.3
Signed-off-by: ERIMROB <robertas.rimkus@est.tech> Issue-ID: DCAEGEN2-2175 Change-Id: I70998a0d643b899c1b4d3ba86346297271a9b276
Diffstat (limited to 'components/pm-subscription-handler/tests')
-rwxr-xr-xcomponents/pm-subscription-handler/tests/test_subscription.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/components/pm-subscription-handler/tests/test_subscription.py b/components/pm-subscription-handler/tests/test_subscription.py
index c95e2ab0..e6ee2b57 100755
--- a/components/pm-subscription-handler/tests/test_subscription.py
+++ b/components/pm-subscription-handler/tests/test_subscription.py
@@ -26,6 +26,7 @@ from tenacity import stop_after_attempt
import mod.aai_client as aai_client
from mod import db, create_app
+from mod.db_models import NetworkFunctionModel
from mod.network_function import NetworkFunction, NetworkFunctionFilter, OrchestrationStatus
from mod.pmsh_utils import AppConfig
from mod.subscription import Subscription
@@ -201,3 +202,19 @@ class SubscriptionTest(TestCase):
actual_sub_event = self.sub_1.prepare_subscription_event(self.nf_1.nf_name, app_conf)
print(actual_sub_event)
self.assertEqual(expected_sub_event, actual_sub_event)
+
+ def test_get_nf_models(self):
+ nf_array = [self.nf_1, self.nf_2]
+ self.sub_1.add_network_functions_to_subscription(nf_array)
+ nf_models = self.sub_1._get_nf_models()
+
+ self.assertEqual(2, len(nf_models))
+ self.assertIsInstance(nf_models[0], NetworkFunctionModel)
+
+ def test_get_network_functions(self):
+ nf_array = [self.nf_1, self.nf_2]
+ self.sub_1.add_network_functions_to_subscription(nf_array)
+ nfs = self.sub_1.get_network_functions()
+
+ self.assertEqual(2, len(nfs))
+ self.assertIsInstance(nfs[0], NetworkFunction)