Esempio n. 1
0
    def testAllocSetBillable(self, getStubMock):
        alloc = facility_pb2.Allocation(name=TEST_ALLOC_NAME)
        isBillable = True
        stubMock = mock.Mock()
        stubMock.SetBillable.return_value = facility_pb2.AllocSetBillableResponse()
        getStubMock.return_value = stubMock

        opencue.api.allocSetBillable(alloc, isBillable)

        stubMock.SetBillable.assert_called_with(
            facility_pb2.AllocSetBillableRequest(allocation=alloc, value=isBillable),
            timeout=mock.ANY)
Esempio n. 2
0
def allocSetBillable(alloc, is_billable):
    """Sets an allocation billable or not.

    :type  alloc: facility_pb2.Allocation
    :param alloc: allocation to set
    :type  is_billable: bool
    :param is_billable: whether alloc should be billable or not
    :rtype:  facility_pb2.AllocSetBillableResponse
    :return: empty response
    """
    return Cuebot.getStub('allocation').SetBillable(
        facility_pb2.AllocSetBillableRequest(allocation=alloc,
                                             value=is_billable),
        timeout=Cuebot.Timeout)
Esempio n. 3
0
def allocSetBillable(alloc, is_billable):
    return Cuebot.getStub('allocation').SetBillable(
        facility_pb2.AllocSetBillableRequest(allocation=alloc,
                                             value=is_billable),
        timeout=Cuebot.Timeout)