def test_dump_load(): x = ("he", 7, "llo", 8, (), 900, None, True, 18.2, 18.2j + 13, slice(1, 2, 3), frozenset([5, 6, 7]), bytes([0x11])) assert dumpable(x) y = dump(x) z = load(y) print(x) print(y) print(z) assert x == z
def test_pickle_direct(): x = {1:2} y = _pickle(x) z = load(bytes([0x01])+y) assert x == z
def test_unloadable(): x = ("he", 7, "llo", 8, (), 900, None, True, 18.2, 18.2j + 13, slice(1, 2, 3), frozenset([5, 6, 7]), bytes([0x11])) y = dump(x) y = bytes([0x02]) + y z = load(y)
def test_pickle_direct(): x = {1: 2} y = _pickle(x) z = load(bytes([0x01]) + y) assert x == z