tests: Add tests to improve coverage of objstr.c.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user