tests: Add tests to improve coverage of objstr.c.

This commit is contained in:
Damien George
2015-09-03 23:06:18 +01:00
parent e2aa117798
commit 25afc7da0d
13 changed files with 81 additions and 0 deletions

View File

@@ -14,6 +14,18 @@ print(bytes(array('h', [0x101, 0x202])))
# long ints
print(ord(bytes([14953042807679334000 & 0xff])))
# constructor value out of range
try:
bytes([-1])
except ValueError:
print('ValueError')
# constructor value out of range
try:
bytes([256])
except ValueError:
print('ValueError')
# error in construction
try:
a = bytes([1, 2, 3], 1)