

@mock.patch.object(glance.api, 'glance')
def test_image_create_bad_visibility(self, gc):
    request = self.mock_rest_request(body='{"name": "Test",\n            "disk_format": "aki", "import_data": false,\n            "visibility": "verybad", "container_format": "aki",\n            "protected": false, "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        ')
    response = glance.Images().post(request)
    request.assertStatusCode(response, 400)
    self.assertEqual(response.content.decode('utf-8'), '"invalid visibility option: verybad"')

dataset/ETHPy150Open openstack/horizon/openstack_dashboard/test/api_tests/glance_rest_tests.py ImagesRestTestCase.test_image_create_bad_visibility/VarMisuse@50/196 `self`->`request`