mirror of
https://github.com/openwrt/packages.git
synced 2026-04-29 14:44:56 +04:00
python-constantly: Update to 23.10.4, add new build dependency
This also adds a test.sh script for the packages feed CI. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
committed by
Tianling Shen
parent
8acd006b6e
commit
1fbe4b9a8b
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$1" = python3-constantly ] || exit 0
|
||||
|
||||
python3 - << 'EOF'
|
||||
|
||||
from constantly import NamedConstant, Names
|
||||
class Letters(Names):
|
||||
a = NamedConstant()
|
||||
b = NamedConstant()
|
||||
c = NamedConstant()
|
||||
|
||||
assert Letters.lookupByName('a') is Letters.a
|
||||
assert Letters.a < Letters.b
|
||||
assert Letters.b < Letters.c
|
||||
assert Letters.a < Letters.c
|
||||
|
||||
from constantly import ValueConstant, Values
|
||||
class STATUS(Values):
|
||||
OK = ValueConstant('200')
|
||||
FOUND = ValueConstant('302')
|
||||
NOT_FOUND = ValueConstant('404')
|
||||
|
||||
assert STATUS.OK.value == '200'
|
||||
assert STATUS.lookupByValue('404') == STATUS.NOT_FOUND
|
||||
|
||||
EOF
|
||||
Reference in New Issue
Block a user