def test_int_list_to_bin(self): self.assertEqual(int_list_to_bin([]), 0) self.assertEqual(int_list_to_bin([0]), 1) self.assertEqual(int_list_to_bin([1]), 2) self.assertEqual(int_list_to_bin([0, 1]), 3) self.assertEqual(int_list_to_bin([2]), 4) self.assertEqual(int_list_to_bin([7, 30]), (1 << 7) + (1 << 30))
def to_glyphs_gasp_table(value): return { str(record["rangeMaxPPEM"]): int_list_to_bin(record["rangeGaspBehavior"]) for record in value }