summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/tests/test_pmsh_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/pm-subscription-handler/tests/test_pmsh_utils.py')
-rw-r--r--components/pm-subscription-handler/tests/test_pmsh_utils.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/components/pm-subscription-handler/tests/test_pmsh_utils.py b/components/pm-subscription-handler/tests/test_pmsh_utils.py
index 1711e013..53d4fe64 100644
--- a/components/pm-subscription-handler/tests/test_pmsh_utils.py
+++ b/components/pm-subscription-handler/tests/test_pmsh_utils.py
@@ -165,6 +165,44 @@ class PmshUtilsTestCase(BaseClassSetup):
with self.assertRaises(ValidationError):
self.app_conf.validate_sub_schema()
+ def test_utils_validate_config_subscription_nfFilter_not_empty(self):
+ self.app_conf.subscription.nfFilter = {
+ "nfNames": [
+
+ ],
+ "modelInvariantIDs": [
+
+ ],
+ "modelVersionIDs": [
+
+ ],
+ "modelNames": [
+
+ ]
+ }
+ with self.assertRaises(ValidationError):
+ self.app_conf.validate_sub_schema()
+
+ @patch('mod.logger.debug')
+ def test_utils_validate_config_subscription_nfFilter_with_empty_property(self, mock_logger):
+ self.app_conf.subscription.nfFilter = {
+ "nfNames": [
+ "^pnf.*",
+ "^vnf.*"
+ ],
+ "modelInvariantIDs": [
+ "7129e420-d396-4efb-af02-6b83499b12f8"
+ ],
+ "modelVersionIDs": [
+
+ ],
+ "modelNames": [
+ "pnf102"
+ ]
+ }
+ self.app_conf.validate_sub_schema()
+ mock_logger.assert_called_with("Subscription schema is valid.")
+
def test_utils_validate_config_subscription_where_measurementTypes_is_empty(self):
self.app_conf.subscription.measurementGroups = [{
"measurementGroup": {