Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
def test_unpickable():
    x = (NotImplemented)
    y = dump(x)
Exemple #4
0
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)
Exemple #5
0
def test_undumpable():
    x = dump({1:2})
Exemple #6
0
def test_unpickable():
    x = (NotImplemented)
    y = dump(x)
Exemple #7
0
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)
Exemple #8
0
def test_undumpable():
    x = dump({1: 2})