def test_body_size(self): m = b'l\1\0\1\4\0\0\0\1\0\0\0\0\0\0\0b234' self.assertEqual(parse_dbus_header(m), len(m)) for l in range(16, len(m)): self.assertEqual(parse_dbus_header(m[:l]), len(m))
def test_padding(self): m = b'l\1\0\1\0\0\0\0\1\0\0\0\11\0\0\0h234567812345678' self.assertEqual(parse_dbus_header(m), len(m)) for l in range(16, len(m)): self.assertEqual(parse_dbus_header(m[:l]), len(m))
def test_big_endian(self): m = b'B\1\0\1\0\0\0\0\0\0\0\1\0\0\0\0' self.assertEqual(parse_dbus_header(m), len(m))
def test_header_array(self): m = b'l\1\0\1\0\0\0\0\1\0\0\0\10\0\0\0h2345678' self.assertEqual(parse_dbus_header(m), len(m)) for l in range(16, len(m)): self.assertEqual(parse_dbus_header(m[:l]), len(m))
def test_simple(self): m = b'l\1\0\1\0\0\0\0\1\0\0\0\0\0\0\0' self.assertEqual(parse_dbus_header(m), len(m))