Skip to content

Commit 50a3a5b

Browse files
committed
Fixed doctest
1 parent 8d8f369 commit 50a3a5b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

conversions/base64_to_binary.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,11 @@ def base64_to_bin(base64_str: str) -> str:
7575
'-011010011011011100'
7676
>>> base64_to_bin(" a-bc ")
7777
Traceback (most recent call last):
78-
File "<stdin>", line 1, in <module>
79-
File "<stdin>", line 15, in base64_to_bin
78+
...
8079
ValueError: Invalid base64 string. Invalid char - at pos 1
8180
>>> base64_to_bin("")
8281
Traceback (most recent call last):
83-
File "/usr/lib/python3.12/doctest.py", line 1368, in __run
84-
exec(compile(example.source, filename, "single",
85-
File "<doctest __main__.base64_to_bin[3]>", line 1, in <module>
86-
base64_to_bin("")
87-
File "/home/sidd/Projects/PythonAlgorithms/./conversions/base64_to_binary.py", line 89, in base64_to_bin
88-
raise ValueError("Empty string was passed to the function")
82+
...
8983
ValueError: Empty string was passed to the function
9084
"""
9185
b64_str = str(base64_str).strip()

0 commit comments

Comments
 (0)