summaryrefslogtreecommitdiff
path: root/tests/basics/bytes_construct.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-09-03 23:06:18 +0100
committerDamien George <damien.p.george@gmail.com>2015-09-03 23:06:18 +0100
commit25afc7da0db43754f6b4373a10b66551dd3cbd57 (patch)
treee2e116af73a03aaf6e11b4b0065e5f73eb6a91af /tests/basics/bytes_construct.py
parente2aa1177986d11cbd19ab84ca41b6f0dce51ad01 (diff)
tests: Add tests to improve coverage of objstr.c.
Diffstat (limited to 'tests/basics/bytes_construct.py')
-rw-r--r--tests/basics/bytes_construct.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basics/bytes_construct.py b/tests/basics/bytes_construct.py
index e43c8179f..59e02f063 100644
--- a/tests/basics/bytes_construct.py
+++ b/tests/basics/bytes_construct.py
@@ -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)