tests: Add test for int.from_bytes() for arbitrary-precision integer.

This test works only for MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_MPZ
and needs a way of skipping in other cases.
This commit is contained in:
Paul Sokolovsky 2017-01-21 20:15:31 +03:00
parent e6ab43e2c0
commit 3b09dca046
3 changed files with 7 additions and 6 deletions

View File

@ -0,0 +1,7 @@
b = bytes(range(20))
il = int.from_bytes(b, "little")
ib = int.from_bytes(b, "big")
print(il)
print(ib)
print(il.to_bytes(20, "little"))

View File

@ -2,8 +2,3 @@ try:
print((10).to_bytes(1, "big"))
except Exception as e:
print(type(e))
try:
print(int.from_bytes(b"\0", "big"))
except Exception as e:
print(type(e))

View File

@ -1,2 +1 @@
<class 'NotImplementedError'>
<class 'NotImplementedError'>