diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/qpid/codec.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/python/qpid/codec.py b/python/qpid/codec.py index 3c1e73c2e6..b0b596b89c 100644 --- a/python/qpid/codec.py +++ b/python/qpid/codec.py @@ -214,41 +214,3 @@ class Codec: return self.decode_longstr() else: return ReferenceId(self.decode_longstr()) - -def test(type, value): - if isinstance(value, (list, tuple)): - values = value - else: - values = [value] - stream = StringIO() - codec = Codec(stream) - for v in values: - codec.encode(type, v) - codec.flush() - enc = stream.getvalue() - stream.reset() - dup = [] - for i in xrange(len(values)): - dup.append(codec.decode(type)) - if values != dup: - raise AssertionError("%r --> %r --> %r" % (values, enc, dup)) - -if __name__ == "__main__": - def dotest(type, value): - args = (type, value) - test(*args) - - for value in ("1", "0", "110", "011", "11001", "10101", "10011"): - for i in range(10): - dotest("bit", map(lambda x: x == "1", value*i)) - - for value in ({}, {"asdf": "fdsa", "fdsa": 1, "three": 3}, {"one": 1}): - dotest("table", value) - - for type in ("octet", "short", "long", "longlong"): - for value in range(0, 256): - dotest(type, value) - - for type in ("shortstr", "longstr"): - for value in ("", "a", "asdf"): - dotest(type, value) |
