

@mock.patch.object(objects.ImageMeta, 'from_dict')
def test_image_meta_from_image_as_dict(self, from_dict):
    image_meta = objects.ImageMeta(name='foo')
    from_dict.return_value = image_meta
    spec = objects.RequestSpec()
    spec._image_meta_from_image({
        'name': 'foo',
    })
    self.assertEqual(image_meta, spec.image)

dataset/ETHPy150Open openstack/nova/nova/tests/unit/objects/test_request_spec.py _TestRequestSpecObject.test_image_meta_from_image_as_dict/original