Exemple #1
0
	def test_decodeFailed(self):
		for s in (str(-1) + 'N', str(-2**53) + 'N', str(2**53 + 1) + 'N', ' ', '00' + 'N', '0' * 1024):
			self.assertRaises(
				InvalidFrame,
				lambda: SeqNumFrame.decode(sf(s)))
Exemple #2
0
	def test_decode(self):
		for seqNum in (0, 1, 2**32, 2**53):
			s = str(seqNum) + 'N'
			self.assertEqual(
				SeqNumFrame(seqNum),
				SeqNumFrame.decode(sf(s)))