aboutsummaryrefslogtreecommitdiff
path: root/lang/python/python-cryptography/test.sh
diff options
context:
space:
mode:
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