'If user doesn\'t pass in diskConfig for server, use image metadata
to specify AUTO or MANUAL.'

def test_create_server_detect_from_image(self):

    req = fakes.HTTPRequest.blank('/fake/servers')
    req.method = 'POST'
    req.content_type = 'application/json'
    body = {'server': {'name': 'server_test', 'imageRef': 'a440c04b-79fa-479c-bed1-0b816eaec379', 'flavorRef': '1'}}
    req.body = jsonutils.dump_as_bytes(body)
    res = req.get_response(self.app)
    server_dict = jsonutils.loads(res.body)['server']
    self.assertDiskConfig(server_dict, 'MANUAL')
    req = fakes.HTTPRequest.blank('/fake/servers')
    req.method = 'POST'
    req.content_type = 'application/json'
    body = {'server': {'name': 'server_test', 'imageRef': '70a599e0-31e7-49b7-b260-868f441e862b', 'flavorRef': '1'}}
    req.body = jsonutils.dump_as_bytes(body)
    res = req.get_response(self.app)
    server_dict = jsonutils.loads(res.body)['server']
    self.assertDiskConfig(server_dict, 'AUTO')
