- def test_get_vnf_metric_list(self):
- with self.subTest("Test case1 failed in test_get_vnf_metric_list"):
- metric_list = self.pmjobs_topic._get_vnf_metric_list(self.nsr_id)
- self.assertCountEqual(metric_list, self.metric_check_list,
- "VNF metric list is not correctly fetched")
- with self.subTest("Test case2 failed in test_get_vnf_metric_list"):
- wrong_ns_id = "88d90b0c-faff-4bbc-cccc-aaaaaaaaaaaa"
- with self.assertRaises(EngineException, msg="ns not found") as e:
- self.pmjobs_topic._get_vnf_metric_list(wrong_ns_id)
- self.assertEqual(e.exception.http_code, HTTPStatus.NOT_FOUND, "Wrong HTTP status code")
- self.assertIn("NS not found with id {}".format(wrong_ns_id),
- str(e.exception), "Wrong exception text")
-