Beispiel #1
0
 def test_salesforce_route(self):
     expected_data = {"event_id": "some_event"}
     report_route = ["salesforce_route"]
     self.salesforce_send.return_value = 200
     route = RoutesPipeline(report_route, json.dumps(expected_data))
     route_ran = route.run()
     assert route_ran
Beispiel #2
0
 def test_firefox_route(self):
     expected_data = {"event_id": "some_event"}
     report_route = ["firefox_route"]
     self.sns_client.return_value = MockClient()
     route = RoutesPipeline(report_route, json.dumps(expected_data))
     route_ran = route.run()
     assert route_ran["ResponseMetadata"]["HTTPStatusCode"] == 200
Beispiel #3
0
 def test_invalid_route(self):
     expected_data = {"some": "value"}
     report_route = ["invalid_route"]
     self.mock_run_pipeline.return_value = UnsupportedStaticRouteError(
         report_route, StaticRoutes)
     route = RoutesPipeline(report_route, expected_data)
     with pytest.raises(UnsupportedStaticRouteError):
         route.run()
Beispiel #4
0
 def send_to_routes(report_routes, message_to_route) -> None:
     logger.info(
         "send to routes",
         report_routes=report_routes,
         message_to_route=message_to_route,
     )
     RoutesPipeline(report_routes, message_to_route).run()