Loading src/monitoring/service/EventTools.py +0 −3 Original line number Diff line number Diff line Loading @@ -93,12 +93,9 @@ class EventsDeviceCollector: kpi_id = self._monitoring_client.CreateKpi(kpi_descriptor) kpi_id_list.append(kpi_id) return kpi_id_list except ServiceException as e: LOGGER.exception('ListenEvents exception') except Exception as e: # pragma: no cover LOGGER.exception('ListenEvents exception') src/monitoring/tests/test_unitary.py +4 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ # limitations under the License. import copy, logging, os, pytest from time import sleep from typing import Tuple from common.Constants import ServiceNameEnum from common.Settings import ( Loading Loading @@ -414,6 +415,9 @@ def test_listen_events( response = device_client.AddDevice(Device(**device_with_connect_rules)) assert response.device_uuid.uuid == DEVICE_DEV1_UUID sleep(0.1) kpi_id_list = events_collector.listen_events() assert len(kpi_id_list) > 0 events_collector.stop() Loading
src/monitoring/service/EventTools.py +0 −3 Original line number Diff line number Diff line Loading @@ -93,12 +93,9 @@ class EventsDeviceCollector: kpi_id = self._monitoring_client.CreateKpi(kpi_descriptor) kpi_id_list.append(kpi_id) return kpi_id_list except ServiceException as e: LOGGER.exception('ListenEvents exception') except Exception as e: # pragma: no cover LOGGER.exception('ListenEvents exception')
src/monitoring/tests/test_unitary.py +4 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ # limitations under the License. import copy, logging, os, pytest from time import sleep from typing import Tuple from common.Constants import ServiceNameEnum from common.Settings import ( Loading Loading @@ -414,6 +415,9 @@ def test_listen_events( response = device_client.AddDevice(Device(**device_with_connect_rules)) assert response.device_uuid.uuid == DEVICE_DEV1_UUID sleep(0.1) kpi_id_list = events_collector.listen_events() assert len(kpi_id_list) > 0 events_collector.stop()