def test_many_multi_byte_values(self): self.assertEqual( encode([0x2000, 0x123456, 0xFFFFFFF, 0x0, 0x3FFF, 0x4000]), [ 0xC0, 0x0, 0xC8, 0xE8, 0x56, 0xFF, 0xFF, 0xFF, 0x7F, 0x0, 0xFF, 0x7F, 0x81, 0x80, 0x0, ], )
def test_arbitrary_quintuple_byte(self): self.assertEqual(encode([0xFF000000]), [0x8F, 0xF8, 0x80, 0x80, 0x0])
def test_largest_quadruple_byte(self): self.assertEqual(encode([0xFFFFFFF]), [0xFF, 0xFF, 0xFF, 0x7F])
def test_smallest_triple_byte(self): self.assertEqual(encode([0x4000]), [0x81, 0x80, 0x0])
def test_arbitrary_double_byte(self): self.assertEqual(encode([0x2000]), [0xC0, 0x0])
def test_largest_single_byte(self): self.assertEqual(encode([0x7F]), [0x7F])
def test_many_multi_byte_values(self): self.assertEqual( encode([0x2000, 0x123456, 0xfffffff, 0x0, 0x3fff, 0x4000]), [ 0xc0, 0x0, 0xc8, 0xe8, 0x56, 0xff, 0xff, 0xff, 0x7f, 0x0, 0xff, 0x7f, 0x81, 0x80, 0x0 ])
def test_arbitrary_single_byte(self): self.assertEqual(encode([0x40]), [0x40])
def test_largest_quadruple_byte(self): self.assertEqual(encode([0xfffffff]), [0xff, 0xff, 0xff, 0x7f])
def test_arbitrary_quadruple_byte(self): self.assertEqual(encode([0x8000000]), [0xc0, 0x80, 0x80, 0x0])
def test_largest_double_byte(self): self.assertEqual(encode([0x3fff]), [0xff, 0x7f])
def test_arbitrary_double_byte(self): self.assertEqual(encode([0x2000]), [0xc0, 0x0])
def test_smallest_double_byte(self): self.assertEqual(encode([0x80]), [0x81, 0x0])
def test_largest_single_byte(self): self.assertEqual(encode([0x7f]), [0x7f])
def test_two_single_byte_values(self): self.assertEqual(encode([0x40, 0x7F]), [0x40, 0x7F])
def test_smallest_quintuple_byte(self): self.assertEqual(encode([0x10000000]), [0x81, 0x80, 0x80, 0x80, 0x0])
def test_arbitrary_quintuple_byte(self): self.assertEqual(encode([0xff000000]), [0x8f, 0xf8, 0x80, 0x80, 0x0])
def test_maximum_32_bit_integer_input(self): self.assertEqual(encode([0xffffffff]), [0x8f, 0xff, 0xff, 0xff, 0x7f])
def test_two_single_byte_values(self): self.assertEqual(encode([0x40, 0x7f]), [0x40, 0x7f])
def test_two_multi_byte_values(self): self.assertEqual( encode([0x4000, 0x123456]), [0x81, 0x80, 0x0, 0xc8, 0xe8, 0x56])
def test_largest_double_byte(self): self.assertEqual(encode([0x3FFF]), [0xFF, 0x7F])
def test_many_multi_byte_values(self): self.assertEqual( encode([0x2000, 0x123456, 0xfffffff, 0x0, 0x3fff, 0x4000]), [0xc0, 0x0, 0xc8, 0xe8, 0x56, 0xff, 0xff, 0xff, 0x7f, 0x0, 0xff, 0x7f, 0x81, 0x80, 0x0] )
def test_arbitrary_quadruple_byte(self): self.assertEqual(encode([0x8000000]), [0xC0, 0x80, 0x80, 0x0])
def test_zero(self): self.assertEqual(encode([0x0]), [0x0])
def test_maximum_32_bit_integer_input(self): self.assertEqual(encode([0xFFFFFFFF]), [0x8F, 0xFF, 0xFF, 0xFF, 0x7F])
def test_arbitrary_triple_byte(self): self.assertEqual(encode([0x100000]), [0xc0, 0x80, 0x0])
def test_two_multi_byte_values(self): self.assertEqual(encode([0x4000, 0x123456]), [0x81, 0x80, 0x0, 0xC8, 0xE8, 0x56])
def test_arbitrary_single_byte(self): self.assertEqual(encode([0x40]), [0x40]) # 64 dec. - limit for 7bits encoding