diff options
Diffstat (limited to 'Biz/Bild/Example.py')
-rw-r--r-- | Biz/Bild/Example.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Biz/Bild/Example.py b/Biz/Bild/Example.py index 78a8a6a..25686fa 100644 --- a/Biz/Bild/Example.py +++ b/Biz/Bild/Example.py @@ -1,15 +1,16 @@ +""" +Example Python file that also serves as a test case for bild. +fernet.""" # : out example # : dep cryptography import sys -from typing import List - -from cryptography.fernet import Fernet +import cryptography.fernet def cryptic_hello(name: str) -> str: "Example taken from `cryptography` docs." - key = Fernet.generate_key() - f = Fernet(key) + key = cryptography.fernet.Fernet.generate_key() + f = cryptography.fernet.Fernet(key) token = f.encrypt(hello(name).encode("utf-8")) ret = f.decrypt(token).decode("utf-8") assert ret == hello(name) @@ -17,10 +18,12 @@ def cryptic_hello(name: str) -> str: def hello(name: str) -> str: + "Say hello" return f"Hello {name}" def main() -> None: + "Entrypoint" if "test" in sys.argv: print("testing success") print(cryptic_hello("world")) |