Beispiel #1
0
 def getMatchers(self):
     """Returns the matchers in this filter
     @rtype:  list<Matcher>
     @return: A list of the matchers in this filter"""
     response = self.stub.GetMatchers(filter_pb2.FilterGetMatchersRequest(filter=self.data),
                                      timeout=Cuebot.Timeout)
     return [Matcher(matcher) for matcher in response.matchers.matchers]
Beispiel #2
0
    def getMatchers(self):
        """Returns the filter matchers.

        :rtype:  list<opencue.wrapper.filter.Matcher>
        :return: list of the filter matchers
        """
        response = self.stub.GetMatchers(
            filter_pb2.FilterGetMatchersRequest(filter=self.data),
            timeout=Cuebot.Timeout)
        return [Matcher(matcher) for matcher in response.matchers.matchers]
Beispiel #3
0
    def testGetMatchers(self, getStubMock):
        matcherId = 'mmm-mmmm-mmm'
        stubMock = mock.Mock()
        stubMock.GetMatchers.return_value = filter_pb2.FilterGetMatchersResponse(
            matchers=filter_pb2.MatcherSeq(matchers=[filter_pb2.Matcher(id=matcherId)]))
        getStubMock.return_value = stubMock

        filterForMatchers = opencue.wrappers.filter.Filter(filter_pb2.Filter(name=TEST_FILTER_NAME))
        matchers = filterForMatchers.getMatchers()

        stubMock.GetMatchers.assert_called_with(
            filter_pb2.FilterGetMatchersRequest(filter=filterForMatchers.data), timeout=mock.ANY)
        self.assertEqual(len(matchers), 1)
        self.assertEqual(matchers[0].id(), matcherId)