Exemplo n.º 1
0
 def test_hex_to_base64_sample_input(self):
     self.assertEqual('SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t',
                      hex_to_base64('49276d206b696c6c696e6720796f757220627261696e206c'
                                    '696b65206120706f69736f6e6f7573206d757368726f6f6d'))
Exemplo n.º 2
0
 def test_hex_to_base64_mixed_case(self):
     self.assertEqual('//', hex_to_base64('fff'))
     self.assertEqual('//', hex_to_base64('FfF'))
     self.assertEqual('//', hex_to_base64('FFF'))
Exemplo n.º 3
0
 def test_hex_to_base64_padding(self):
     self.assertEqual('AA', hex_to_base64('0'))
     self.assertEqual('AA', hex_to_base64('00'))
     self.assertEqual(hex_to_base64('00f'), hex_to_base64('f'))
     self.assertEqual(hex_to_base64('0f0'), hex_to_base64('f0'))
     self.assertEqual(hex_to_base64('00afff'), hex_to_base64('afff'))
Exemplo n.º 4
0
 def test_hex_to_base64(self):
     self.assertEqual('', hex_to_base64(''))
     self.assertEqual('AA', hex_to_base64('000'))