kopia lustrzana https://github.com/micropython/micropython-lib
pickle: test_pickle.py: Update for bytes being returned/consumed.
rodzic
22527a6ebd
commit
1c30e28c40
|
@ -5,6 +5,7 @@ import io
|
|||
|
||||
def roundtrip(val):
|
||||
t = pickle.dumps(val)
|
||||
assert isinstance(t, bytes)
|
||||
t = pickle.loads(t)
|
||||
assert t == val
|
||||
|
||||
|
@ -18,7 +19,7 @@ roundtrip([1, 2])
|
|||
roundtrip({1:2, 3: 4})
|
||||
|
||||
try:
|
||||
pickle.loads("1; import micropython")
|
||||
pickle.loads(b"1; import micropython")
|
||||
assert 0, "SyntaxError expected"
|
||||
except SyntaxError:
|
||||
pass
|
||||
|
|
Ładowanie…
Reference in New Issue