Exemplo n.º 1
0
 def test2bytes(self):
     self.assertEqual(a2msbi([1, 0]), 0x100)
     self.assertEqual(a2msbi([0xff, 0]), 0xff00)
     self.assertEqual(a2msbi([0x80, 0]), 0x8000)
     self.assertEqual(a2msbi([0, 1]), 0x1)
     self.assertEqual(a2msbi([0, 0xff]), 0xff)
     self.assertEqual(a2msbi([0, 0x80]), 0x80)
 def test2bytes(self):
     self.assertEqual(a2msbi([1, 0]), 0x100)
     self.assertEqual(a2msbi([0xff, 0]), 0xff00)
     self.assertEqual(a2msbi([0x80, 0]), 0x8000)
     self.assertEqual(a2msbi([0, 1]), 0x1)
     self.assertEqual(a2msbi([0, 0xff]), 0xff)
     self.assertEqual(a2msbi([0, 0x80]), 0x80)
Exemplo n.º 3
0
 def test1byte(self):
     self.assertEqual(a2msbi([8]), 8)
     self.assertEqual(a2msbi([0xff]), 0xff)
     self.assertEqual(a2msbi([0x80]), 0x80)
Exemplo n.º 4
0
 def test0(self):
     self.assertEqual(a2msbi([0]), 0)
     self.assertEqual(a2msbi([0] * 3), 0)
     self.assertEqual(a2msbi([0] * 10), 0)
 def test1byte(self):
     self.assertEqual(a2msbi([8]), 8)
     self.assertEqual(a2msbi([0xff]), 0xff)
     self.assertEqual(a2msbi([0x80]), 0x80)
 def test0(self):
     self.assertEqual(a2msbi([0]), 0)
     self.assertEqual(a2msbi([0]*3), 0)
     self.assertEqual(a2msbi([0]*10), 0)