Commit graph

5 commits

Author SHA1 Message Date
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
c94916d7de
jw.pkg.lib.Uri: Add unit test
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m48s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m29s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m7s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m14s
CI / Packaging test (push) Successful in 0s

The Uri class provides URL parsing and manipulation utilities used throughout jw-pkg. Add a unit test covering URL parsing, credential handling, path manipulation, and safe string formatting.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-25 19:08:02 +02:00
45f8e8cc89
test + python-tools.sh: Fix toplevel "make all" fallout
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m14s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m20s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m45s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m52s
CI / Packaging test (push) Successful in 0s

After a pipeline change, CI now runs "make all" in a repo's root, which uncovers two problems:

1. The help integration test only succeeded as long CI didn't run "make all" before "make test". That way, the checked out repository lacked the generated __init__.py files needed for some modular subcommands to be fully loaded, and hence, the test should have failed. The entire machinery only worked because the subcommands in question are not not essential to building jw-pkg itself: "secrets" and "posix". So, this commit adapts the help integration test to the new reality.

2. Regarding python-tools.sh: Commit 55060486 satisfies yapf in some places of the source code, but in others not anylonger. So patch python-tools.sh's newline handling again.

While not thematically similar, both fixes get baked into one commit to satisfy the requirement that every single commit needs to pass "make clean all check test" individually.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-25 18:28:36 +02:00
efc5bc1c60
test: Add subdirectory with integration test
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m38s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m39s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m21s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m32s
CI / Packaging test (push) Successful in 0s

Add a test/integration subdirectory as a location for integration tests. The first tests that are added are unproblematic in that they don't need superuser privileges to run:

- help: Recursively check if jw-pkg.py's help messages are unchanged

- packages ls: Check if the bash package exists and contains

/usr/bin/bash /usr/bin/bashbug

Let's see how that fares in CI.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-25 14:40:53 +02:00