def getParentFilter(self): """Returns the filter the action belongs to. :rtype: opencue.wrappers.filter.Filter :return: the filter the action belongs to """ response = self.stub.GetParentFilter( filter_pb2.ActionGetParentFilterRequest(action=self.data), timeout=Cuebot.Timeout) return Filter(response.filter)
def testGetParentFilter(self, getStubMock): stubMock = mock.Mock() stubMock.GetParentFilter.return_value = filter_pb2.ActionGetParentFilterResponse( filter=filter_pb2.Filter(name=TEST_FILTER_NAME)) getStubMock.return_value = stubMock action = opencue.wrappers.filter.Action(filter_pb2.Action(id=TEST_ACTION_ID)) filterReturned = action.getParentFilter() stubMock.GetParentFilter.assert_called_with( filter_pb2.ActionGetParentFilterRequest(action=action.data), timeout=mock.ANY) self.assertEqual(filterReturned.name(), TEST_FILTER_NAME)
def getParentFilter(self): response = self.stub.GetParentFilter( filter_pb2.ActionGetParentFilterRequest(action=self.data), timeout=Cuebot.Timeout) return Filter(response.filter)