[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="87.5" output="89"/>
|
||||||
<map input="100" output="100"/>
|
<map input="100" output="100"/>
|
||||||
</axis>
|
</axis>
|
||||||
<mappings description="all mappings">
|
<mappings description="mappings 1">
|
||||||
<mapping description="test mapping">
|
<mapping description="justify low">
|
||||||
<input>
|
<input>
|
||||||
<dimension name="Justify" xvalue="-100"/>
|
<dimension name="Justify" xvalue="-100"/>
|
||||||
<dimension name="Width" xvalue="100"/>
|
<dimension name="Width" xvalue="100"/>
|
||||||
@ -30,6 +30,17 @@
|
|||||||
</output>
|
</output>
|
||||||
</mapping>
|
</mapping>
|
||||||
</mappings>
|
</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>
|
</axes>
|
||||||
<variable-fonts>
|
<variable-fonts>
|
||||||
<variable-font name="NotoSansArabic_Justify_Width">
|
<variable-font name="NotoSansArabic_Justify_Width">
|
||||||
|
@ -701,7 +701,7 @@ def test_axisMappingsRoundtrip(tmpdir):
|
|||||||
doc = DesignSpaceDocument()
|
doc = DesignSpaceDocument()
|
||||||
doc.read(testDocPath)
|
doc.read(testDocPath)
|
||||||
assert doc.axisMappings
|
assert doc.axisMappings
|
||||||
assert len(doc.axisMappings) == 1
|
assert len(doc.axisMappings) == 2
|
||||||
assert doc.axisMappings[0].inputLocation == {"Justify": -100.0, "Width": 100.0}
|
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
|
# 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 = DesignSpaceDocument()
|
||||||
ds.read(datadir / "test_avar2.designspace")
|
ds.read(datadir / "test_avar2.designspace")
|
||||||
_, subDoc = next(splitInterpolable(ds))
|
_, subDoc = next(splitInterpolable(ds))
|
||||||
assert len(subDoc.axisMappings) == 1
|
assert len(subDoc.axisMappings) == 2
|
||||||
|
|
||||||
subDocs = list(splitVariableFonts(ds))
|
subDocs = list(splitVariableFonts(ds))
|
||||||
assert len(subDocs) == 5
|
assert len(subDocs) == 5
|
||||||
for i, (_, subDoc) in enumerate(subDocs):
|
for i, (_, subDoc) in enumerate(subDocs):
|
||||||
# Only the first one should have a mapping, according to the document
|
# Only the first one should have a mapping, according to the document
|
||||||
if i == 0:
|
if i == 0:
|
||||||
assert len(subDoc.axisMappings) == 1
|
assert len(subDoc.axisMappings) == 2
|
||||||
else:
|
else:
|
||||||
assert len(subDoc.axisMappings) == 0
|
assert len(subDoc.axisMappings) == 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user