Files
packages/lang/python/python-augeas/test.sh
Alexandru Ardelean 51a6db0b86 python-augeas: bump to 1.2.0
Changes since 1.1.0:
- Python 3.11+ compatibility fixes
- Drop Python 2 support
- Various bug fixes and maintenance updates

Drop upstreamed patch: 001-backport-ffi-fix.patch

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2026-03-22 17:44:12 +02:00

29 lines
663 B
Bash

#!/bin/sh
[ "$1" = python3-augeas ] || exit 0
python3 - <<'EOF'
import augeas
# Basic instantiation (in-memory, no files touched)
a = augeas.Augeas(root="/dev/null", loadpath=None,
flags=augeas.Augeas.NO_LOAD | augeas.Augeas.NO_MODL_AUTOLOAD)
# Set and get a value
a.set("/test/key", "value")
assert a.get("/test/key") == "value", "get after set failed"
# Match
a.set("/test/a", "1")
a.set("/test/b", "2")
matches = a.match("/test/*")
assert len(matches) == 3, f"Expected 3 matches, got {len(matches)}"
# Remove
a.remove("/test/key")
assert a.get("/test/key") is None, "Expected None after remove"
a.close()
print("python-augeas OK")
EOF