def test_get_v2_image_details_dict(self): dict = { 'status': None, 'updated': None, 'created': None, 'id': None, 'progress': None, 'metadata': None, 'size': None, 'container_format': None, 'disk_format': None, 'is_public': None, 'protected': None, 'owner': None, 'minDisk': None, 'minRam': None, 'name': None, 'visibility': None, 'links': [{ 'href': None, 'rel': None }, { 'href': None, 'rel': None }] } app, req, image, tenant_id = (MagicMock(), MagicMock(), MagicMock(), MagicMock()) res = get_v2_image_details_dict(app, req, image, tenant_id) self.assertEquals(set(dict.keys()), set(res.keys()))
def test_get_v2_image_details_dict(self): dict = { 'status': None, 'updated': None, 'created': None, 'id': None, 'progress': None, 'metadata': None, 'size': None, 'container_format': None, 'disk_format': None, 'is_public': None, 'protected': None, 'owner': None, 'minDisk': None, 'minRam': None, 'name': None, 'visibility': None, 'links': [{'href': None, 'rel': None}, {'href': None, 'rel': None}]} app, req, image, tenant_id = ( MagicMock(), MagicMock(), MagicMock(), MagicMock()) res = get_v2_image_details_dict(app, req, image, tenant_id) self.assertEquals(set(dict.keys()), set(res.keys()))
def test_get_v2_image_details_dict(self): expected_keys = [ 'status', 'updated', 'created', 'id', 'progress', 'metadata', 'size', 'container_format', 'disk_format', 'is_public', 'protected', 'owner', 'min_disk', 'min_ram', 'name', 'visibility', 'links', 'tags', ] app, req, image, tenant_id = (mock.MagicMock(), mock.MagicMock(), mock.MagicMock(), mock.MagicMock()) res = images.get_v2_image_details_dict(app, req, image, tenant_id) self.assertEqual(set(expected_keys), set(res.keys()))
def test_get_v2_image_details_dict_fail(self): app, req, image, tenant_id = (mock.MagicMock(), mock.MagicMock(), None, mock.MagicMock()) res = images.get_v2_image_details_dict(app, req, image, tenant_id) self.assertFalse(res)
def test_get_v2_image_details_dict(self): expected_keys = [ 'status', 'updated', 'created', 'id', 'progress', 'metadata', 'size', 'container_format', 'disk_format', 'is_public', 'protected', 'owner', 'min_disk', 'min_ram', 'name', 'visibility', 'links', ] app, req, image, tenant_id = (mock.MagicMock(), mock.MagicMock(), mock.MagicMock(), mock.MagicMock()) res = images.get_v2_image_details_dict(app, req, image, tenant_id) self.assertEquals(set(expected_keys), set(res.keys()))
def test_get_v2_image_details_dict_fail(self): app, req, image, tenant_id = (MagicMock(), MagicMock(), None, MagicMock()) res = get_v2_image_details_dict(app, req, image, tenant_id) self.assertFalse(res)