summaryrefslogtreecommitdiff
path: root/lang/python/python-cryptography/test.sh
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2023-10-31 11:53:33 +0800
committerTianling Shen <cnsztl@gmail.com>2023-12-08 22:44:26 +0800
commit672a209367de4f3dbfc98066df28a206b4f3d5fe (patch)
tree4f4927f56200120458bc417d0b9a6fb25abb0c40 /lang/python/python-cryptography/test.sh
parent49bc08ec1de75f0076e1d546d1b4d261e04488a7 (diff)
python-cryptography: Update to 41.0.5
This also adds a CPE ID for the package and updates the test.sh script to use an assert. Signed-off-by: Jeffery To <jeffery.to@gmail.com> (cherry picked from commit c4a223ed8714d43a6e06d9c675447281f8c50127)
Diffstat (limited to 'lang/python/python-cryptography/test.sh')
-rw-r--r--lang/python/python-cryptography/test.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/lang/python/python-cryptography/test.sh b/lang/python/python-cryptography/test.sh
index b706d561a..308f5456b 100644
--- a/lang/python/python-cryptography/test.sh
+++ b/lang/python/python-cryptography/test.sh
@@ -2,11 +2,13 @@
[ "$1" = python3-cryptography ] || exit 0
-python3 - << EOF
-import sys
+python3 - << 'EOF'
+
from cryptography.fernet import Fernet
key = Fernet.generate_key()
f = Fernet(key)
-token = f.encrypt(b"my deep dark secret")
-sys.exit(0 if f.decrypt(token) == b"my deep dark secret" else 1)
+msg = b"my deep dark secret"
+token = f.encrypt(msg)
+assert f.decrypt(token) == msg
+
EOF