예제 #1
0
	def test_invalidPB64ShouldFail(self):
		b64 = 'EK230K--"()'
		nb = decodeB64Padless(b64)
		self.assertEqual(nb, None)
		
		b64 = 'azod!'
		nb = decodeB64Padless(b64)
		self.assertEqual(nb, None)
		
		b64 = 'azijhfaz=='
		nb = decodeB64Padless(b64)
		self.assertEqual(nb, None)
예제 #2
0
	def test_backAndForth(self):
		nb = 23456
		b64 = encodeB64Padless(nb)
		nb2 = decodeB64Padless(b64)
		self.assertEqual(nb, nb2)
		
		nb = 0
		b64 = encodeB64Padless(nb)
		nb2 = decodeB64Padless(b64)
		self.assertEqual(nb, nb2)
		
		nb = 12452512512412465125125124
		b64 = encodeB64Padless(nb)
		nb2 = decodeB64Padless(b64)
		self.assertEqual(nb, nb2)
		
		nb = 1234
		b64 = encodeB64Padless(nb)
		nb2 = decodeB64Padless(b64)
		self.assertEqual(nb, nb2)