コード例 #1
0
    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)
コード例 #2
0
ファイル: Messages.py プロジェクト: KPyda/tinyos-2.x-contrib
    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)
コード例 #3
0
 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)
コード例 #4
0
ファイル: Messages.py プロジェクト: KPyda/tinyos-2.x-contrib
 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)