'Upload initial image, then attempt to upload duplicate image'

def test_duplicate_image_upload(self):

    path = '/v1/images'
    (response, content) = self.http.request(path, 'GET')
    self.assertEqual(http_client.OK, response.status)
    self.assertEqual('{"images":    []}', content)
    headers = {'Content-Type': 'application/octet-stream', 'X-Image-Meta-Name': 'Image1', 'X-Image-Meta-Status': 'active', 'X-Image-Meta-Container-Format': 'ovf', 'X-Image-Meta-Disk-Format': 'vdi', 'X-Image-Meta-Size': '19', 'X-Image-Meta-Is-Public': 'True'}
    path = '/v1/images'
    (response, content) = self.http.request(path, 'POST', headers=headers)
    self.assertEqual(http_client.CREATED, response.status)
    image = jsonutils.loads(content)['image']
    headers = {'Content-Type': 'application/octet-stream', 'X-Image-Meta-Name': 'Image1    Update', 'X-Image-Meta-Status': 'active', 'X-Image-Meta-Container-Format': 'ovf', 'X-Image-Meta-Disk-Format': 'vdi', 'X-Image-Meta-Size': '19', 'X-Image-Meta-Id': image['id'], 'X-Image-Meta-Is-Public': 'True'}
    path = '/v1/images'
    (response, content) = self.http.request(path, 'POST', headers=headers)
    self.assertEqual(http_client.CONFLICT, response.status)
