mirror of
https://github.com/openwrt/packages.git
synced 2026-05-31 15:02:01 +08:00
python-flask-babel: update to 4.0.0; add test.sh
Changes since 3.1.0: - drop Python 3.7 support; add PyPy 3.9 compatibility - replace deprecated locked_cached_property with cached_property Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
committed by
Alexandru Ardelean
parent
2a998b61db
commit
c391447d12
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$1" = python3-flask-babel ] || exit 0
|
||||
|
||||
python3 - <<'EOF'
|
||||
from flask import Flask
|
||||
from flask_babel import Babel, gettext, lazy_gettext
|
||||
|
||||
app = Flask(__name__)
|
||||
babel = Babel(app)
|
||||
|
||||
with app.app_context():
|
||||
result = gettext("Hello")
|
||||
assert isinstance(result, str), "gettext should return a string"
|
||||
|
||||
lazy = lazy_gettext("World")
|
||||
assert str(lazy) == "World", f"lazy_gettext failed: {lazy!r}"
|
||||
|
||||
print("python3-flask-babel OK")
|
||||
EOF
|
||||
Reference in New Issue
Block a user