Пример #1
0
def getDepend(uniq):
    """Finds a dependency from its unique ID.

    :type id: str
    :param id: the unique ID of the Depend object
    :rtype: opencue.wrappers.depend.Depend
    :return: a dependency"""
    return Depend(Cuebot.getStub('depend').GetDepend(
        depend_pb2.DependGetDependRequest(id=uniq), timeout=Cuebot.Timeout).depend)
Пример #2
0
def getDepend(uniq):
    """Finds a dependency from its unique ID.
    @type id: str
    @param id: the unique ID of the Depend object
    @rtype: Depend
    @return: a dependency"""
    return Depend(
        Cuebot.getStub('depend').GetDepend(
            depend_pb2.DependGetDependRequest(id=uniq),
            timeout=Cuebot.Timeout).depend)
Пример #3
0
    def testGetDepend(self, getStubMock):
        arbitraryId = '00000000-0000-0000-0000-012345678980'
        stubMock = mock.Mock()
        stubMock.GetDepend.return_value = depend_pb2.DependGetDependResponse(
            depend=depend_pb2.Depend(id=arbitraryId))
        getStubMock.return_value = stubMock

        depend = opencue.api.getDepend(arbitraryId)

        stubMock.GetDepend.assert_called_with(
            depend_pb2.DependGetDependRequest(id=arbitraryId), timeout=mock.ANY)
        self.assertEqual(arbitraryId, depend.id())