def test_short(self): for i in range(256): val = randint(0, 65535) w = AMQPWriter() w.write_short(val) s = w.getvalue() r = AMQPReader(s) self.assertEqual(r.read_short(), val)