Exemplo n.º 1
0
 def testListFlowLogsWorksIfFlowWasCreatedBySameRouter(self):
     flow_id = self._CreateFlowWithRobotId()
     router = self._CreateRouter(
         list_flow_logs=rr.RobotRouterListFlowLogsParams(enabled=True))
     router.ListFlowLogs(api_flow.ApiListFlowLogsArgs(
         client_id=self.client_id, flow_id=flow_id),
                         token=self.token)
Exemplo n.º 2
0
    def testListFlowLogsRaisesIfFlowWasNotCreatedBySameUser(self):
        flow_id = flow_test_lib.StartFlow(file_finder.FileFinder,
                                          self.client_id,
                                          creator=self.another_username)

        router = self._CreateRouter(
            list_flow_logs=rr.RobotRouterListFlowLogsParams(enabled=True))
        with self.assertRaises(access_control.UnauthorizedAccess):
            router.ListFlowLogs(api_flow.ApiListFlowLogsArgs(
                client_id=self.client_id, flow_id=flow_id),
                                context=self.context)
Exemplo n.º 3
0
    def testListFlowLogsRaisesIfFlowWasNotCreatedBySameRouter(self):
        flow_urn = flow.StartAFF4Flow(
            client_id=self.client_id,
            flow_name=file_finder.FileFinder.__name__,
            token=self.token)

        router = self._CreateRouter(
            list_flow_logs=rr.RobotRouterListFlowLogsParams(enabled=True))
        with self.assertRaises(access_control.UnauthorizedAccess):
            router.ListFlowLogs(api_flow.ApiListFlowLogsArgs(
                client_id=self.client_id, flow_id=flow_urn.Basename()),
                                token=self.token)