'Shared implementation for tests below that create instance.'

def setUp(self):

    super(ServersControllerCreateTestWithMock, self).setUp()
    self.flags(enable_instance_password=True, group='api')
    self.instance_cache_num = 0
    self.instance_cache_by_id = {}
    self.instance_cache_by_uuid = {}
    ext_info = extension_info.LoadedExtensionInfo()
    self.controller = servers.ServersController(extension_info=ext_info)
    self.body = {'server': {'name': 'server_test', 'imageRef': self.image_uuid, 'flavorRef': self.flavor_ref, 'metadata': {'hello': 'world', 'open': 'stack'}}}
    self.req = fakes.HTTPRequest.blank('/fake/servers')
    self.req.method = 'POST'
    self.req.headers['content-type'] = 'application/json'
