jw-python/test/unit/python
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jan Lindemann 503c620341
load_yaml: _resolve_link(): Add context to errors
When a link's target path cannot be resolved, the raw KeyError from
_resolve_path() propagates to the caller (or a raw TypeError when a
path segment hits a list), without saying which link or which
document location caused the failure.  The parse-and-resolve
sequence is also duplicated in the jw.link and jw.inplace-link
branches of _expand_links_recursive().

Extract the sequence into _resolve_link() and wrap navigation
failures in ValueError naming the link kind, the spec, and the
location in the document.  Document that path navigation operates on
the unexpanded tree, so intermediate segments must not be link nodes
themselves.  Update the tests that pinned KeyError and add coverage
for the list-navigation case and the error message content.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-08-25 19:35:02 +02:00
..
jw load_yaml: _resolve_link(): Add context to errors 2026-08-25 19:35:02 +02:00
Makefile stree.StringTree: Add unit tests 2026-08-12 23:10:12 +00:00