

def test_from_flavor_as_dict(self):
    flavor_dict = dict(id=1)
    ctxt = context.RequestContext('fake', 'fake')
    spec = objects.RequestSpec(ctxt)
    spec._from_flavor(flavor_dict)
    self.assertIsInstance(spec.flavor, objects.Flavor)
    self.assertEqual({
        'id': 1,
    }, spec.flavor.obj_get_changes())

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