def getActions(self): """Returns the actions in this filter @rtype: list<Action> @return: A list of the actions in this filter""" response = self.stub.GetActions(filter_pb2.FilterGetActionsRequest(filter=self.data), timeout=Cuebot.Timeout) return [Action(action) for action in response.actions.actions]
def getActions(self): """Returns the filter actions. :rtype: list<opencue.wrappers.filter.Action> :return: list of the filter actions """ response = self.stub.GetActions( filter_pb2.FilterGetActionsRequest(filter=self.data), timeout=Cuebot.Timeout) return [Action(action) for action in response.actions.actions]
def testGetActions(self, getStubMock): actionId = 'aaa-aaaa-aaa' stubMock = mock.Mock() stubMock.GetActions.return_value = filter_pb2.FilterGetActionsResponse( actions=filter_pb2.ActionSeq(actions=[filter_pb2.Action(id=actionId)])) getStubMock.return_value = stubMock filterForActions = opencue.wrappers.filter.Filter(filter_pb2.Filter(name=TEST_FILTER_NAME)) actions = filterForActions.getActions() stubMock.GetActions.assert_called_with( filter_pb2.FilterGetActionsRequest(filter=filterForActions.data), timeout=mock.ANY) self.assertEqual(len(actions), 1) self.assertEqual(actions[0].id(), actionId)