Beispiel #1
0
 def run(self) -> Optional[Any]:
     for r in self.report_routes:
         if r == StaticRoutes.SALESFORCE_ROUTE:
             return self.send_to_salesforce(self.data)
         else:
             raise UnsupportedStaticRouteError(r,
                                               StaticRoutes)  # type: ignore
Beispiel #2
0
 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()
Beispiel #3
0
 def run(self) -> None:
     for r in self.report_routes:
         if r == StaticRoutes.SALESFORCE_ROUTE:
             SalesforceRoute(self.data).route()
         elif r == StaticRoutes.FIREFOX_ROUTE:
             FirefoxRoute(self.data).route()
         else:
             raise UnsupportedStaticRouteError(r, StaticRoutes)
Beispiel #4
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()