

def test_create(self):
    req_obj = fake_request_spec.fake_spec_obj(remove_id=True)

    def _test_create_args(self2, context, changes):
        self._check_update_primitive(req_obj, changes)
        changes['id'] = 42
        return changes
    with mock.patch.object(request_spec.RequestSpec, '_create_in_db', _test_create_args):
        req_obj.create()

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