Esempio n. 1
0
    def testDeleteAlloc(self, getStubMock):
        allocToDelete = facility_pb2.Allocation(name=TEST_ALLOC_NAME)
        stubMock = mock.Mock()
        stubMock.Delete.return_value = facility_pb2.AllocDeleteResponse()
        getStubMock.return_value = stubMock

        opencue.api.deleteAllocation(allocToDelete)

        stubMock.Delete.assert_called_with(
            facility_pb2.AllocDeleteRequest(allocation=allocToDelete), timeout=mock.ANY)
Esempio n. 2
0
def deleteAllocation(alloc):
    """Deletes an allocation.

    :type  alloc: facility_pb2.Allocation
    :param alloc: allocation to delete
    :rtype:  facility_pb2.AllocDeleteResponse
    :return: empty response"""
    return Cuebot.getStub('allocation').Delete(
        facility_pb2.AllocDeleteRequest(allocation=alloc),
        timeout=Cuebot.Timeout)
Esempio n. 3
0
    def testDelete(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.Delete.return_value = facility_pb2.AllocDeleteResponse()
        getStubMock.return_value = stubMock

        alloc = opencue.wrappers.allocation.Allocation(
            facility_pb2.Allocation(name=TEST_ALLOC_NAME))
        alloc.delete()

        stubMock.Delete.assert_called_with(
            facility_pb2.AllocDeleteRequest(allocation=alloc.data), timeout=mock.ANY)
Esempio n. 4
0
 def delete(self):
     """Deletes the allocation."""
     self.stub.Delete(facility_pb2.AllocDeleteRequest(allocation=self.data),
                      timeout=Cuebot.Timeout)
Esempio n. 5
0
 def delete(self):
     """Delete the record of the allocation from the cuebot"""
     self.stub.Delete(
         facility_pb2.AllocDeleteRequest(allocation=self.data),
         timeout=Cuebot.Timeout
     )
Esempio n. 6
0
def deleteAllocation(alloc):
    return Cuebot.getStub('allocation').Delete(
        facility_pb2.AllocDeleteRequest(allocation=alloc),
        timeout=Cuebot.Timeout)