Example #1
0
def renameFacility(facility, new_name):
    """Rename a given facility by name or unique ID.
    @type facility: str
    @param facility: an existing facility name or unique ID
    @type new_name: str
    @param new_name: a new facility name or unique ID
    """
    Cuebot.getStub('facility').Rename(facility_pb2.FacilityRenameRequest(
        facility=facility, new_name=new_name),
                                      timeout=Cuebot.Timeout)
Example #2
0
    def testRenameFacility(self, getStubMock):
        facility = facility_pb2.Facility(name=TEST_FACILITY_NAME)
        newName = 'new-name'
        stubMock = mock.Mock()
        stubMock.Rename.return_value = facility_pb2.FacilityRenameResponse()
        getStubMock.return_value = stubMock

        opencue.api.renameFacility(facility, newName)

        stubMock.Rename.assert_called_with(
            facility_pb2.FacilityRenameRequest(facility=facility, new_name=newName),
            timeout=mock.ANY)
Example #3
0
def renameFacility(facility, new_name):
    Cuebot.getStub('facility').Rename(facility_pb2.FacilityRenameRequest(
        facility=facility, new_name=new_name),
                                      timeout=Cuebot.Timeout)