示例#1
0
def test_encode_decode():
    r"""Test encode/decode for valid objects."""
    for x in _valid_objects.values():
        y = datatypes.encode(x)
        z = datatypes.decode(y)
        assert_equal(z, x)
        datatypes.encode_data(x)
示例#2
0
def test_encode_decode():
    r"""Test encode/decode for valid objects."""
    for x in _valid_objects.values():
        y = datatypes.encode(x)
        z = datatypes.decode(y)
        assert_equal(z, x)
        t = datatypes.encode_type(x)
        d = datatypes.encode_data(x)
        w = datatypes.decode_data(d, t)
        assert_equal(w, x)
    assert_raises(ValueError, datatypes.decode_data, b'', None)
示例#3
0
def test_encode_decode_readable():
    r"""Test encode_data_reable/decode for valid objects."""
    for x in _valid_objects.values():
        datatypes.encode_data_readable(x)