Exemple #1
0
 def renameTag(self, oldTag, newTag):
     """Renames a tag
     @type oldTag: str
     @param oldTag: The old tag to rename
     @type newTag: str
     @param newTag: The new name for the tag
     """
     self.stub.RenameTag(
         host_pb2.HostRenameTagRequest(host=self.data, old_tag=oldTag, new_tag=newTag),
         timeout=Cuebot.Timeout)
Exemple #2
0
    def testRenameTag(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.RenameTag.return_value = host_pb2.HostRenameTagResponse()
        getStubMock.return_value = stubMock

        oldTag = 'sad'
        newTag = 'happy'
        host = opencue.wrappers.host.Host(host_pb2.Host(name=TEST_HOST_NAME))
        host.renameTag(oldTag, newTag)

        stubMock.RenameTag.assert_called_with(host_pb2.HostRenameTagRequest(
            host=host.data, old_tag=oldTag, new_tag=newTag),
                                              timeout=mock.ANY)