diff options
author | Rafael H. Schloming <rhs@apache.org> | 2007-05-30 22:12:19 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2007-05-30 22:12:19 +0000 |
commit | 6b965ef06930f48540723a3712cc5d9aa71a6e7f (patch) | |
tree | d0849bf26823eaeb03b703a9f8a9521cb9387850 /qpid/python/qpid/codec.py | |
parent | 841952bc7ff00003df619701ac481e27d7bf9635 (diff) | |
download | qpid-python-6b965ef06930f48540723a3712cc5d9aa71a6e7f.tar.gz |
tests moved to test directory
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@542957 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/qpid/codec.py')
-rw-r--r-- | qpid/python/qpid/codec.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/qpid/python/qpid/codec.py b/qpid/python/qpid/codec.py index 3c1e73c2e6..b0b596b89c 100644 --- a/qpid/python/qpid/codec.py +++ b/qpid/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) |