Commit graph jw-python/test/unit/python/jw/util/Options/Makefile
Author SHA1 Message Date
e076d5778b
test/parse_opts: Replace with Options unit test
The parse_opts test is a plain script that constructs an Options from
sys.argv and crashed on the first get() call, because the by_index
condition in Options.get() is inverted and raises KeyError for an integer
index. It has several shortcomings, though:

- "make test" doesn't execute it, only make -C test/parse_opts run, so CI
  doesn't run it
- It doesn't adhere to standard janware directory layout
- It's very basic

Replace the script with a pytest module under
test/unit/python/jw/util/Options, following the layout of the sibling
unit test directories: a Makefile including py-test.mk and a test.py
discovered by pytest. The module covers parsing of option strings, repeated
keys, JSON values, flags, get() with defaults and the by_index parameter,
__contains__, __iter__, keys(), str() and update().

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
2026-09-18 09:47:35 +02:00