Exemplo n.º 1
0
def createFacility(name):
    """Create a given facility by name or unique ID.
    @type name: str
    @param name: a facility name or unique ID
    @rtype: Facility
    @return: a facility object
    """
    return Cuebot.getStub('facility').Create(
        facility_pb2.FacilityCreateRequest(name=name),
        timeout=Cuebot.Timeout).facility
Exemplo n.º 2
0
    def testCreateFacility(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.Create.return_value = facility_pb2.FacilityCreateResponse(
            facility=facility_pb2.Facility(name=TEST_FACILITY_NAME))
        getStubMock.return_value = stubMock

        newFacility = opencue.api.createFacility(TEST_FACILITY_NAME)

        stubMock.Create.assert_called_with(
            facility_pb2.FacilityCreateRequest(name=TEST_FACILITY_NAME), timeout=mock.ANY)
        self.assertEqual(TEST_FACILITY_NAME, newFacility.name)
Exemplo n.º 3
0
def createFacility(name):
    return Cuebot.getStub('facility').Create(
        facility_pb2.FacilityCreateRequest(name=name),
        timeout=Cuebot.Timeout).facility