

@staticmethod
def create_one_server(attrs=None, methods=None):
    'Create a fake server.\n\n        :param Dictionary attrs:\n            A dictionary with all attributes\n        :param Dictionary methods:\n            A dictionary with all methods\n        :return:\n            A FakeResource object, with id, name, metadata\n        '
    attrs = (attrs or {
        
    })
    methods = (methods or {
        
    })
    server_info = {
        'id': ('server-id-' + uuid.uuid4().hex),
        'name': ('server-name-' + uuid.uuid4().hex),
        'metadata': {
            
        },
        'image': {
            'id': ('image-id-' + uuid.uuid4().hex),
        },
        'flavor': {
            'id': ('flavor-id-' + uuid.uuid4().hex),
        },
    }
    server_info.update(attrs)
    server = fakes.FakeResource(info=copy.deepcopy(server_info), methods=methods, loaded=True)
    return server

dataset/ETHPy150Open dtroyer/python-openstackclient/openstackclient/tests/compute/v2/fakes.py FakeServer.create_one_server/original