

def _check_update_primitive(self, req_obj, changes):
    self.assertEqual(req_obj.instance_uuid, changes['instance_uuid'])
    serialized_obj = objects.RequestSpec.obj_from_primitive(jsonutils.loads(changes['spec']))
    for field in ['instance_uuid', 'num_instances', 'ignore_hosts', 'project_id', 'scheduler_hints', 'force_hosts', 'availability_zone', 'force_nodes']:
        self.assertEqual(getattr(req_obj, field), getattr(serialized_obj, field))
    for field in ['image', 'numa_topology', 'pci_requests', 'flavor', 'retry', 'limits', 'instance_group']:
        self.assertDictEqual(getattr(req_obj, field).obj_to_primitive(), getattr(serialized_obj, field).obj_to_primitive())

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