@@ -24,6 +24,14 @@ def encrypt(plaintext: str, key: str) -> str:
2424 Traceback (most recent call last):
2525 ...
2626 ValueError: plaintext is empty
27+ >>> encrypt("coffee is good as python", "")
28+ Traceback (most recent call last):
29+ ...
30+ ValueError: key is empty
31+ >>> encrypt(527.26, "TheAlgorithms")
32+ Traceback (most recent call last):
33+ ...
34+ TypeError: plaintext must be a string
2735 """
2836 if not isinstance (plaintext , str ):
2937 raise TypeError ("plaintext must be a string" )
@@ -80,6 +88,14 @@ def decrypt(ciphertext: str, key: str) -> str:
8088 Traceback (most recent call last):
8189 ...
8290 TypeError: ciphertext must be a string
91+ >>> decrypt("", "TheAlgorithms")
92+ Traceback (most recent call last):
93+ ...
94+ ValueError: ciphertext is empty
95+ >>> decrypt("vvjfpk wj ohvp su ddylsv", 2)
96+ Traceback (most recent call last):
97+ ...
98+ TypeError: key must be a string
8399 """
84100 if not isinstance (ciphertext , str ):
85101 raise TypeError ("ciphertext must be a string" )
0 commit comments