Commit graph

6 commits

Author SHA1 Message Date
8734b90f72
test: apply yapf formatting to test.py files

Yapf complains about spacing inconsistencies around assignment operators in function calls, fix that.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:35:17 +02:00
ad9c5b581a
lib.ProjectConf: Clean up temp files

The _load() helper in test/unit/python/jw/pkg/lib/ProjectConf/test.py uses tempfile.NamedTemporaryFile(..., delete=False) but never removes the created files. Each test call leaked a .conf file in /tmp.

Track all created paths in a _tmpfiles list and call _cleanup() at the end of the test to unlink them.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:35:06 +02:00
62803a4a1b
lib.Uri: Return 'file' scheme for local paths

The scheme property returns 'file://' for local paths instead of 'file', causing scheme_plus_authority to produce 'file://://' with a triple slash.

Also fix the test to expect 'file' instead of 'file://'.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.80.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-04 07:21:43 +02:00
Jan Lindemann
2ca66e34ba
test: ProjectConf: Add unit tests

Add unit tests for the new ProjectConf module covering:

- Basic string and list value retrieval (get_str(), get_str_or_none(), get_list(), get_list_or_none()) - Quoted values with preserved spaces and comment delimiters - Inline comments outside quotes - Comma-separated lists with quoted commas - Line continuations - Multiple sections - Error cases: empty key, missing key/section, malformed sections, unfinished continuations, unclosed quotes - Error class is a subclass of ValueError

Also include a Makefile for running tests via `make test`.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-30 12:46:42 +02:00
78f57c7547
jw.pkg.lib.Result: Add unit test
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m28s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m10s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m43s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m58s
CI / Packaging test (push) Successful in 0s

Add a unit test for the Result class covering:

- stdout/stderr property access with various status values - None output handling and exception behavior - Encoding and strip_output property setters - cmd and wd setters - summary, summarize, and __repr__ behavior - matches_error pattern matching

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-25 20:57:22 +02:00
f4d40efc05
test: Move unit tests below jw/pkg

Move the unit test hierarchy to below test/unit/python/jw/pkg. Nesting the subdirectories so deeply might be overly careful, but it may as well be not - maybe in the future installable test packages are going to be generated and need simple ways to install without stepping onto each other's toes. If not, it's easier to cut two directory components out than having to reorganize possibly incoherent paths grown over multiple packages.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-25 20:57:05 +02:00