open-notebook/tests
Luis Novo 7c4dd6cd89
fix(api): return 404 instead of 500 for missing resources in CRUD endpoints (#862) (#924)
* fix(api): return 404 instead of 500 for missing resources in CRUD endpoints (#862)

ObjectModel.get() raises NotFoundError for a missing record (never returns a
falsy value), so the 'if not obj: 404' guards were dead code and each handler's
broad 'except Exception' re-raised NotFoundError as 500, never hitting the global
NotFoundError->404 handler.

Add an explicit 'except NotFoundError -> 404' arm to the affected handlers in
notebooks, notes, models, credentials and embedding routers, plus regression
tests asserting 404 (not 500) when .get() raises NotFoundError.

* refactor(api): remove dead 'if not obj' guards after .get() (cubic #924)

Now that each handler maps NotFoundError -> 404, the 'if not obj: raise 404'
guards are unreachable (.get() raises rather than returning a falsy value).
Drop them; where the fetched object was only used by the guard, keep the .get()
call for its existence-validation side effect without binding an unused var.
2026-06-18 08:23:28 -03:00
..
conftest.py feat: credential-based API key management (#477) (#540) 2026-02-10 08:30:22 -03:00
README.md Initial commit with all features 2024-10-21 14:56:10 -03:00
test_chunking.py fix(embedding): drop degenerate tiny chunks before embedding (#764) (#768) 2026-05-31 09:43:47 -03:00
test_credentials_api.py feat: complete audio matrix (Google/Vertex TTS, Google/ElevenLabs STT) (#835) 2026-06-02 06:32:48 -03:00
test_crud_404.py fix(api): return 404 instead of 500 for missing resources in CRUD endpoints (#862) (#924) 2026-06-18 08:23:28 -03:00
test_domain.py fix(credentials): persist Ollama num_ctx via a flexible config object (#903) 2026-06-16 09:24:35 -03:00
test_embedding.py feat: use token-based sizing for embedding chunking (#749) 2026-04-19 13:49:09 -03:00
test_embedding_commands.py fix(commands): register legacy embedding aliases (#876) 2026-06-17 13:21:19 -03:00
test_graphs.py chore(release): prepare v1.10.0 (#923) 2026-06-18 07:44:05 -03:00
test_models_api.py fix(api): normalize openai_compatible provider name in models endpoint (#801) 2026-05-29 11:14:29 -03:00
test_notes_api.py feat: expose embed command_id in note API responses (#545) 2026-02-14 18:11:23 -03:00
test_podcast_path.py fix: extract build_episode_output_dir helper and test production code 2026-03-11 17:05:42 -05:00
test_search_api.py fix(search): reject non-positive limit and survive highlight overflow (#898) 2026-06-16 04:51:34 -03:00
test_sources_api.py chore(release): prepare v1.10.0 (#923) 2026-06-18 07:44:05 -03:00
test_url_validation.py feat: credential-based API key management (#477) (#540) 2026-02-10 08:30:22 -03:00
test_utils.py fix: handle tiktoken network errors in offline environments (issue #264) 2026-03-10 19:45:14 -05:00

Coming Soon