def getParentFilter(self): """Returns the filter the matcher belongs to. :rtype: opencue.wrappers.filter.Filter :return: the filter the matcher belongs to """ response = self.stub.GetParentFilter( filter_pb2.MatcherGetParentFilterRequest(matcher=self.data), timeout=Cuebot.Timeout) return Filter(response.filter)
def testGetParentFilter(self, getStubMock): stubMock = mock.Mock() stubMock.GetParentFilter.return_value = filter_pb2.MatcherGetParentFilterResponse( filter=filter_pb2.Filter(name=TEST_FILTER_NAME)) getStubMock.return_value = stubMock matcher = opencue.wrappers.filter.Matcher(filter_pb2.Matcher(id=TEST_MATCHER_ID)) filterReturns = matcher.getParentFilter() stubMock.GetParentFilter.assert_called_with( filter_pb2.MatcherGetParentFilterRequest(matcher=matcher.data), timeout=mock.ANY) self.assertEqual(filterReturns.name(), TEST_FILTER_NAME)
def getParentFilter(self): response = self.stub.GetParentFilter( filter_pb2.MatcherGetParentFilterRequest(matcher=self.data), timeout=Cuebot.Timeout) return Filter(response.filter)