Exemplo n.º 1
0
 def test_byte_string_60(self):
     val = 0x111111111111111
     byte_string = short_id._to_byte_string(val, 60)
     self.assertEqual('\x11\x11\x11\x11\x11\x11\x11\x10', byte_string)
Exemplo n.º 2
0
 def test_byte_string_16(self):
     self.assertEqual('\xab\xcd', short_id._to_byte_string(0xabcd, 16))
     self.assertEqual('\x0a\xbc', short_id._to_byte_string(0xabc, 16))
Exemplo n.º 3
0
 def test_byte_string_12(self):
     self.assertEqual('\xab\xc0', short_id._to_byte_string(0xabc, 12))
     self.assertEqual('\x0a\xb0', short_id._to_byte_string(0x0ab, 12))
Exemplo n.º 4
0
 def test_byte_string_8(self):
     self.assertEqual('\xab', short_id._to_byte_string(0xab, 8))
     self.assertEqual('\x05', short_id._to_byte_string(0x05, 8))
Exemplo n.º 5
0
 def test_byte_string_60(self):
     val = 0x111111111111111
     byte_string = short_id._to_byte_string(val, 60)
     self.assertEqual('\x11\x11\x11\x11\x11\x11\x11\x10', byte_string)
Exemplo n.º 6
0
 def test_byte_string_12(self):
     self.assertEqual('\xab\xc0', short_id._to_byte_string(0xabc, 12))
     self.assertEqual('\x0a\xb0', short_id._to_byte_string(0x0ab, 12))
Exemplo n.º 7
0
 def test_byte_string_16(self):
     self.assertEqual('\xab\xcd', short_id._to_byte_string(0xabcd, 16))
     self.assertEqual('\x0a\xbc', short_id._to_byte_string(0xabc, 16))
Exemplo n.º 8
0
 def test_byte_string_8(self):
     self.assertEqual('\xab', short_id._to_byte_string(0xab, 8))
     self.assertEqual('\x05', short_id._to_byte_string(0x05, 8))