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 | ab359d79804a3b87d59294bb4116a4c88a48e531 (patch) | |
| tree | 2b5580220b979203f245342e43b2c0715ec78f27 /python/qpid | |
| parent | 88859adc0c87a2261d39343daab2290dd6b3eb0e (diff) | |
| download | qpid-python-ab359d79804a3b87d59294bb4116a4c88a48e531.tar.gz | |
tests moved to test directory
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@542957 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid')
| -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) |
