[designspace] Update test to exercise multiple <mappings>
This commit is contained in:
parent
96054e8152
commit
4d3d8c5aba
@ -19,8 +19,8 @@
|
||||
<map input="87.5" output="89"/>
|
||||
<map input="100" output="100"/>
|
||||
</axis>
|
||||
<mappings description="all mappings">
|
||||
<mapping description="test mapping">
|
||||
<mappings description="mappings 1">
|
||||
<mapping description="justify low">
|
||||
<input>
|
||||
<dimension name="Justify" xvalue="-100"/>
|
||||
<dimension name="Width" xvalue="100"/>
|
||||
@ -30,6 +30,17 @@
|
||||
</output>
|
||||
</mapping>
|
||||
</mappings>
|
||||
<mappings description="mappings 2">
|
||||
<mapping description="test mapping">
|
||||
<input>
|
||||
<dimension name="Justify" xvalue="100"/>
|
||||
<dimension name="Width" xvalue="70"/>
|
||||
</input>
|
||||
<output>
|
||||
<dimension name="Width" xvalue="100"/>
|
||||
</output>
|
||||
</mapping>
|
||||
</mappings>
|
||||
</axes>
|
||||
<variable-fonts>
|
||||
<variable-font name="NotoSansArabic_Justify_Width">
|
||||
|
@ -701,7 +701,7 @@ def test_axisMappingsRoundtrip(tmpdir):
|
||||
doc = DesignSpaceDocument()
|
||||
doc.read(testDocPath)
|
||||
assert doc.axisMappings
|
||||
assert len(doc.axisMappings) == 1
|
||||
assert len(doc.axisMappings) == 2
|
||||
assert doc.axisMappings[0].inputLocation == {"Justify": -100.0, "Width": 100.0}
|
||||
|
||||
# This is a bit of a hack, but it's the only way to make sure
|
||||
|
@ -217,13 +217,13 @@ def test_avar2(datadir):
|
||||
ds = DesignSpaceDocument()
|
||||
ds.read(datadir / "test_avar2.designspace")
|
||||
_, subDoc = next(splitInterpolable(ds))
|
||||
assert len(subDoc.axisMappings) == 1
|
||||
assert len(subDoc.axisMappings) == 2
|
||||
|
||||
subDocs = list(splitVariableFonts(ds))
|
||||
assert len(subDocs) == 5
|
||||
for i, (_, subDoc) in enumerate(subDocs):
|
||||
# Only the first one should have a mapping, according to the document
|
||||
if i == 0:
|
||||
assert len(subDoc.axisMappings) == 1
|
||||
assert len(subDoc.axisMappings) == 2
|
||||
else:
|
||||
assert len(subDoc.axisMappings) == 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user