mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 19:02:09 +00:00
Changes since 0.22.1: - Require Python >= 3.8 (dropped 3.7) - Performance improvements and internal refactoring - Better type annotations and mypy support - Various bug fixes Also add PKG_BUILD_DEPENDS on python-setuptools/host as bidict uses setuptools.build_meta build backend. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
32 lines
498 B
Bash
32 lines
498 B
Bash
#!/bin/sh
|
|
|
|
[ "$1" = python3-bidict ] || exit 0
|
|
|
|
python3 - <<'EOF'
|
|
from bidict import bidict
|
|
|
|
# Basic creation and lookup
|
|
b = bidict({'a': 1, 'b': 2, 'c': 3})
|
|
assert b['a'] == 1
|
|
assert b.inverse[1] == 'a'
|
|
assert b.inverse[2] == 'b'
|
|
|
|
# Put and update
|
|
b['d'] = 4
|
|
assert b['d'] == 4
|
|
assert b.inverse[4] == 'd'
|
|
|
|
# Delete
|
|
del b['d']
|
|
assert 'd' not in b
|
|
assert 4 not in b.inverse
|
|
|
|
# Inverse of inverse is the original
|
|
assert b.inverse.inverse is b
|
|
|
|
# len
|
|
assert len(b) == 3
|
|
|
|
print("python-bidict OK")
|
|
EOF
|