Пример #1
0
    def testGetProcs(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.GetProcs.return_value = host_pb2.ProcGetProcsResponse(
            procs=host_pb2.ProcSeq(procs=[host_pb2.Proc(name=TEST_PROC_NAME)]))
        getStubMock.return_value = stubMock

        procs = opencue.api.getProcs(show=[TEST_SHOW_NAME], alloc=[TEST_ALLOC_NAME])

        stubMock.GetProcs.assert_called_with(
            host_pb2.ProcGetProcsRequest(
                r=host_pb2.ProcSearchCriteria(shows=[TEST_SHOW_NAME], allocs=[TEST_ALLOC_NAME])),
            timeout=mock.ANY)
        self.assertEqual([TEST_PROC_NAME], [proc.name() for proc in procs])
Пример #2
0
 def byOptions(cls, **options):
     criteria = cls.criteriaFromOptions(**options)
     return Cuebot.getStub('proc').GetProcs(
         host_pb2.ProcGetProcsRequest(r=criteria), timeout=Cuebot.Timeout)
Пример #3
0
 def byOptions(cls, **options):
     """Executes the search using the given options."""
     criteria = cls.criteriaFromOptions(**options)
     return Cuebot.getStub('proc').GetProcs(
         host_pb2.ProcGetProcsRequest(r=criteria), timeout=Cuebot.Timeout)