Skip to content

Commit

Permalink
Add some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy committed Dec 9, 2024
1 parent ee7947a commit 879994e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Lib/test/test_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,10 @@ def test_fromhex(self):
self.assertRaises(ValueError, self.type2test.fromhex, '12 \x00 34')

# For odd number of character(s)
with self.assertRaises(ValueError) as cm:
self.type2test.fromhex("a")
self.assertIn("fromhex() arg must be of even length", str(cm.exception))
for value in ("a", "a ", " a"," a ", "aaa", "aaa ", " aaa", " aaa "):
with self.assertRaises(ValueError) as cm:
self.type2test.fromhex(value)
self.assertIn("fromhex() arg must be of even length", str(cm.exception))

for data, pos in (
# invalid first hexadecimal character
Expand Down

0 comments on commit 879994e

Please sign in to comment.