Changeset 1666
- Timestamp:
- 09/10/08 22:20:14 (2 months ago)
- Location:
- pyamf/branches/impl-indep-test-suite-343/pyamf/tests
- Files:
-
- 2 modified
-
test_amf3.py (modified) (1 diff)
-
util.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pyamf/branches/impl-indep-test-suite-343/pyamf/tests/test_amf3.py
r1662 r1666 418 418 419 419 self._run([ 420 ({'a': u'a', 'b': u'b', 'c': u'c', 'd': u'd'}, 421 '\n\x0b\x01\x03a\x06\x00\x03c\x06\x02\x03b\x06\x04\x03d\x06\x06\x01')]) 420 ({'a': u'a', 'b': u'b', 'c': u'c', 'd': u'd'}, ( 421 '\n\x0b\x01\x03', ( 422 'a\x06\x00\x03', 423 'c\x06\x02\x03', 424 'b\x06\x04\x03', 425 'd\x06\x06\x01' 426 )) 427 )]) 422 428 423 429 x = amf3.Decoder('\n\x0b\x01\x03a\x06\x00\x03c\x06\x02\x03b\x06\x04\x03d\x06\x06\x01') -
pyamf/branches/impl-indep-test-suite-343/pyamf/tests/util.py
r1524 r1666 65 65 self.encoder.writeElement(n) 66 66 67 testcase.assertEqual(self.getval(), s) 67 if isinstance(s, basestring): 68 testcase.assertEqual(self.getval(), s) 69 elif isinstance(s, (tuple, list)): 70 testcase.assertTrue(check_buffer(self.getval(), s)) 68 71 69 72 class DecoderTester(object): … … 118 121 return val == float('-inf') 119 122 123 def check_buffer(buf, parts): 124 assert isinstance(parts, (tuple, list)) 125 126 for part in parts: 127 print repr(part) 128 if isinstance(part, basestring): 129 if buf[0:len(part)] == part: 130 buf = buf[len(part):] 131 elif isinstance(part, (tuple, list)): 132 if check_buffer(buf, part): 133 for p in part: 134 buf = buf[len(part):] 135 136 return len(buf) == 0 120 137 121 138 def replace_dict(src, dest):
