def test_payload_split(self): r = self.r encoded = self.encoded # fully packed for elm in encoded[:-1]: payload_len = len(elm.get_payload()) self.assertEqual(ReactMsg.max_payload(), payload_len) # last does not exceed cap last, = encoded[-1:] payload_len = len(last.get_payload()) self.assert_(ReactMsg.max_payload() >= payload_len)
def setUp(self): cmd = string.join(chr(x) for x in xrange(0, 256)) * 4 self.r = ReactDoMsg(cmd=cmd) self.encoded = ReactMsg.encode(self.r, track_id=13)
def setUp(self): cmd = string.join(chr(x) for x in xrange(0,256)) * 4 self.r = ReactDoMsg(cmd=cmd) self.encoded = ReactMsg.encode(self.r, track_id=13)