tests: Update for required byteorder arg for int.from_bytes()/to_bytes().
This commit is contained in:
parent
9d787de2a1
commit
aee13ef3f2
9
tests/basics/int_bytes_notimpl.py
Normal file
9
tests/basics/int_bytes_notimpl.py
Normal file
@ -0,0 +1,9 @@
|
||||
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))
|
2
tests/basics/int_bytes_notimpl.py.exp
Normal file
2
tests/basics/int_bytes_notimpl.py.exp
Normal file
@ -0,0 +1,2 @@
|
||||
<class 'NotImplementedError'>
|
||||
<class 'NotImplementedError'>
|
@ -14,7 +14,7 @@ desc = {
|
||||
bytes = b"01"
|
||||
|
||||
addr = uctypes.addressof(bytes)
|
||||
buf = addr.to_bytes(uctypes.sizeof(desc))
|
||||
buf = addr.to_bytes(uctypes.sizeof(desc), "little")
|
||||
|
||||
S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.LITTLE_ENDIAN)
|
||||
|
||||
|
@ -15,7 +15,7 @@ desc = {
|
||||
bytes = b"01"
|
||||
|
||||
addr = uctypes.addressof(bytes)
|
||||
buf = addr.to_bytes(uctypes.sizeof(desc))
|
||||
buf = addr.to_bytes(uctypes.sizeof(desc), "little")
|
||||
|
||||
S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.NATIVE)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user