

@mock.patch.object(objects.SchedulerLimits, 'from_dict')
def test_from_primitives(self, mock_limits):
    spec_dict = {
        'instance_type': objects.Flavor(),
        'instance_properties': objects.Instance(uuid=uuidutils.generate_uuid(), numa_topology=None, pci_requests=None, project_id=1, availability_zone='nova'),
    }
    filt_props = {
        
    }
    mock_limits.return_value = None
    ctxt = context.RequestContext('fake', 'fake')
    spec = objects.RequestSpec.from_primitives(ctxt, f, filt_props)
    mock_limits.assert_called_once_with({
        
    })
    for field in [f for f in spec.obj_fields if (f != 'id')]:
        self.assertTrue(spec.obj_attr_is_set(field), ('Field: %s is not set' % field))
    self.assertEqual(ctxt, spec._context)

dataset/ETHPy150Open openstack/nova/nova/tests/unit/objects/test_request_spec.py _TestRequestSpecObject.test_from_primitives/VarMisuse@107/150 `spec_dict`->`f`