def test_buildLookup_conflictingSubtableTypes(self): s1 = builder.buildSingleSubstSubtable({"one": "two"}) s2 = builder.buildAlternateSubstSubtable({"one": ["two", "three"]}) with pytest.raises(AssertionError, match="all subtables must have the same LookupType" ) as excinfo: builder.buildLookup([s1, s2])
def parseAlternate(lines, font, _lookupMap=None): mapping = {} for line in lines: line = makeGlyphs(line) mapping[line[0]] = line[1:] return otl.buildAlternateSubstSubtable(mapping)
def build(self): subtable = otl.buildAlternateSubstSubtable(self.alternates) return self.buildLookup_([subtable])
def test_buildLookup_conflictingSubtableTypes(self): s1 = builder.buildSingleSubstSubtable({"one": "two"}) s2 = builder.buildAlternateSubstSubtable({"one": ["two", "three"]}) self.assertRaisesRegex( AssertionError, "all subtables must have the same LookupType", builder.buildLookup, [s1, s2])