

def test_save(self):
    req_obj = fake_request_spec.fake_spec_obj()

    def _test_save_args(self2, context, instance_uuid, changes):
        self._check_update_primitive(req_obj, changes)
        changes['id'] = 42
        return changes
    with mock.patch.object(request_spec.RequestSpec, '_save_in_db', _test_save_args):
        req_obj.save()

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