def test_invalid_route(self): report_route = ["invalid_route"] self.mock_run_pipeline.return_value = UnsupportedStaticRouteError( report_route, StaticRoutes) expected_data = [dict(route_type="invalid_route", data=None)] route = AllRoutes(expected_data) with pytest.raises(UnsupportedDataError): route.run()
def send_to_all_routes(messages_to_routes): logger.info("send to all routes", messages_to_routes=messages_to_routes) AllRoutes(messages_to_routes).run()
def test_salesforce_route(self): self.salesforce_send.return_value = 200 route = AllRoutes(self.expected_salesforce_data) route_ran = route.run() assert route_ran
def test_firefox_route(self): self.sns_client.return_value = MockClient() route = AllRoutes(self.expected_firefox_data) route_ran = route.run() assert route_ran["ResponseMetadata"]["HTTPStatusCode"] == 200