

def test_from_instance_as_dict(self):
    instance = dict(uuid=uuidutils.generate_uuid(), numa_topology=None, pci_requests=None, project_id=fakes.FAKE_PROJECT_ID, availability_zone='nova')
    spec = objects.RequestSpec()
    spec._from_instance(instance)
    instance_fields = ['numa_topology', 'pci_requests', 'uuid', 'project_id', 'availability_zone']
    for field in instance_fields:
        if (field == 'uuid'):
            self.assertEqual(instance.get(field), getattr(spec, 'instance_uuid'))
        else:
            self.assertEqual(instance.get(field), getattr(instance_fields, field))

dataset/ETHPy150Open openstack/nova/nova/tests/unit/objects/test_request_spec.py _TestRequestSpecObject.test_from_instance_as_dict/VarMisuse@123/176 `spec`->`instance_fields`