summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/tests/test_subscription.py
diff options
context:
space:
mode:
authoremartin <ephraim.martin@est.tech>2020-02-24 14:13:03 +0000
committeremartin <ephraim.martin@est.tech>2020-02-26 15:25:50 +0000
commite7f6914ca5397987eddc6788a6e378c51b12ce52 (patch)
tree1c4a1015afa1030ee3e75fdf78c282a2ce994433 /components/pm-subscription-handler/tests/test_subscription.py
parentde549f5f1bb3e0a6f94e9755ae0800b469114113 (diff)
Handle AAI Update and Delete events for PMSH
Change-Id: I7f84e4429011bbaea4de23077ce23629b897fd7d Issue-ID: DCAEGEN2-1846 Signed-off-by: emartin <ephraim.martin@est.tech>
Diffstat (limited to 'components/pm-subscription-handler/tests/test_subscription.py')
-rwxr-xr-xcomponents/pm-subscription-handler/tests/test_subscription.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/components/pm-subscription-handler/tests/test_subscription.py b/components/pm-subscription-handler/tests/test_subscription.py
index 8fe233e4..c357ad79 100755
--- a/components/pm-subscription-handler/tests/test_subscription.py
+++ b/components/pm-subscription-handler/tests/test_subscription.py
@@ -134,13 +134,16 @@ class SubscriptionTest(TestCase):
self.assertEqual('new_status', sub.status)
def test_delete_subscription(self):
- self.sub_1.create()
- subs = self.sub_1.get_all()
- self.assertEqual(1, len(subs))
+ self.sub_1.add_network_functions_to_subscription([self.nf_1, self.nf_2])
+ self.sub_2.add_network_functions_to_subscription([self.nf_2])
self.sub_1.delete_subscription()
- new_subs = self.sub_1.get_all()
- self.assertEqual(0, len(new_subs))
+
+ self.assertEqual(1, len(Subscription.get_all()))
+ self.assertEqual(None, Subscription.get(self.sub_1.subscriptionName))
+ self.assertEqual(1, len(Subscription.get_all_nfs_subscription_relations()))
+ self.assertEqual(1, len(NetworkFunction.get_all()))
+ self.assertEqual(None, NetworkFunction.get(nf_name=self.nf_1.nf_name))
def test_update_sub_nf_status(self):
sub_name = 'ExtraPM-All-gNB-R2B'