

@mock.patch.object(glance.api, 'glance')
def test_image_edit(self, gc):
    request = self.mock_rest_request(body='{"name": "Test",\n            "disk_format": "aki", "container_format": "aki",\n            "visibility": "public", "protected": false,\n            "image_url": "test.com",\n            "source_type": "url", "architecture": "testArch",\n            "description": "description", "kernel": "kernel",\n            "min_disk": 10, "min_ram": 5, "ramdisk": 10 }\n        ')
    metadata = {
        'name': 'Test',
        'disk_format': 'aki',
        'container_format': 'aki',
        'is_public': True,
        'protected': False,
        'min_disk': 10,
        'min_ram': 5,
        'properties': {
            'description': 'description',
            'architecture': 'testArch',
            'ramdisk_id': 10,
            'kernel_id': 'kernel',
        },
        'purge_props': False,
    }
    response = glance.Image().patch(request, '1')
    self.assertStatusCode(response, 204)
    self.assertEqual(response.content.decode('utf-8'), '')
    gc.image_update.assert_called_once_with(request, '1', **metadata)

dataset/ETHPy150Open openstack/horizon/openstack_dashboard/test/api_tests/glance_rest_tests.py ImagesRestTestCase.test_image_edit/original