

@mock.patch.object(base, 'obj_to_primitive')
def test_to_legacy_image(self, obj_to_primitive):
    spec = objects.RequestSpec(image=objects.ImageMeta())
    fake_dict = mock.Mock()
    obj_to_primitive.return_value = fake_dict
    self.assertEqual(fake_dict, spec._to_legacy_image())
    obj_to_primitive.assert_called_once_with(spec.image)

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