Loading src/opticalattackdetector/tests/test_unitary.py +4 −4 Original line number Diff line number Diff line Loading @@ -58,12 +58,12 @@ def test_detect_attack( message = dbscan.DetectionResponse() message.cluster_indices.extend([0, 1, -1, -1, -1]) monitoring_mock = MockServicerImpl_Monitoring(queue_samples = queue.Queue()) # monitoring_mock = MockServicerImpl_Monitoring(queue_samples = queue.Queue()) # TODO: remove the monitoring mock with patch( "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.attack_mitigator_client" ) as mitigator, patch( "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.monitoring_client", monitoring_mock, "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.monitoring_client.IncludeKpi", ) as monitoring, patch( "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.dbscanserving_client.Detect", # TODO: return dumb object with "cluster_indices" attribute Loading @@ -77,5 +77,5 @@ def test_detect_attack( request.kpi_id.kpi_id.uuid = "1" optical_attack_detector_client.DetectAttack(request) dbscanserving.assert_called_once() monitoring.IncludeKpi.assert_called_once() monitoring.assert_called_once() mitigator.NotifyAttack.assert_called() Loading
src/opticalattackdetector/tests/test_unitary.py +4 −4 Original line number Diff line number Diff line Loading @@ -58,12 +58,12 @@ def test_detect_attack( message = dbscan.DetectionResponse() message.cluster_indices.extend([0, 1, -1, -1, -1]) monitoring_mock = MockServicerImpl_Monitoring(queue_samples = queue.Queue()) # monitoring_mock = MockServicerImpl_Monitoring(queue_samples = queue.Queue()) # TODO: remove the monitoring mock with patch( "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.attack_mitigator_client" ) as mitigator, patch( "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.monitoring_client", monitoring_mock, "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.monitoring_client.IncludeKpi", ) as monitoring, patch( "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.dbscanserving_client.Detect", # TODO: return dumb object with "cluster_indices" attribute Loading @@ -77,5 +77,5 @@ def test_detect_attack( request.kpi_id.kpi_id.uuid = "1" optical_attack_detector_client.DetectAttack(request) dbscanserving.assert_called_once() monitoring.IncludeKpi.assert_called_once() monitoring.assert_called_once() mitigator.NotifyAttack.assert_called()