tests: Catch ValueError instead of any exception to properly test error.

This commit is contained in:
Damien George 2015-07-06 11:35:08 +00:00
parent 722d4842df
commit 68e8b595de
1 changed files with 8 additions and 8 deletions

View File

@ -18,17 +18,17 @@ print(binascii.a2b_base64(b'MTIzNEFCQ0RhYmNk'))
try:
print(binascii.a2b_base64(b'abc'))
except:
print("caught")
except ValueError:
print("ValueError")
try:
print(binascii.a2b_base64(b'abcde='))
except:
print("caught")
except ValueError:
print("ValueError")
try:
print(binascii.a2b_base64(b'ab*d'))
except:
print("caught")
except ValueError:
print("ValueError")
try:
print(binascii.a2b_base64(b'ab=cdef='))
except:
print("caught")
except ValueError:
print("ValueError")