- # async def test_prom_metric_request(self):
- # with self.subTest("Test case1 failed in test_prom"):
- # prom_response = yaml.load(prom_res, Loader=yaml.Loader)
- # with aioresponses() as mock_res:
- # self.set_get_mock_res(mock_res, self.nsr_id, self.metric_check_list)
- # result = await self.pmjobs_topic._prom_metric_request(self.nsr_id, self.metric_check_list)
- # self.assertCountEqual(result, prom_response, "Metric Data is valid")
- # with self.subTest("Test case2 failed in test_prom"):
- # with self.assertRaises(EngineException, msg="Prometheus not reachable") as e:
- # await self.pmjobs_topic._prom_metric_request(self.nsr_id, self.metric_check_list)
- # self.assertIn("Connection to ", str(e.exception), "Wrong exception text")
+ async def test_prom_metric_request(self):
+ with self.subTest("Test case1 failed in test_prom"):
+ prom_response = yaml.load(prom_res, Loader=yaml.Loader)
+ with aioresponses() as mock_res:
+ self.set_get_mock_res(mock_res, self.nsr_id, self.metric_check_list)
+ result = await self.pmjobs_topic._prom_metric_request(self.nsr_id, self.metric_check_list)
+ self.assertCountEqual(result, prom_response, "Metric Data is valid")
+ with self.subTest("Test case2 failed in test_prom"):
+ with self.assertRaises(EngineException, msg="Prometheus not reachable") as e:
+ await self.pmjobs_topic._prom_metric_request(self.nsr_id, self.metric_check_list)
+ self.assertIn("Connection to ", str(e.exception), "Wrong exception text")