perform some testing with <rules processing=...> and doc.rulesProcessingLast
This commit is contained in:
parent
f9b04572f6
commit
f4925fff44
@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<designspace format="4.0">
|
||||
<designspace format="4.1">
|
||||
<axes>
|
||||
<axis tag="wght" name="weight" minimum="0" maximum="1000" default="0">
|
||||
<labelname xml:lang="en">Wéíght</labelname>
|
||||
@ -13,7 +13,7 @@
|
||||
<map input="1000" output="990"/>
|
||||
</axis>
|
||||
</axes>
|
||||
<rules>
|
||||
<rules processing="last">
|
||||
<rule name="named.rule.1">
|
||||
<conditionset>
|
||||
<condition name="axisName_a" minimum="0" maximum="1"/>
|
||||
|
@ -49,6 +49,7 @@ def test_fill_document(tmpdir):
|
||||
instancePath1 = os.path.join(tmpdir, "instances", "instanceTest1.ufo")
|
||||
instancePath2 = os.path.join(tmpdir, "instances", "instanceTest2.ufo")
|
||||
doc = DesignSpaceDocument()
|
||||
doc.rulesProcessingLast = True
|
||||
|
||||
# write some axes
|
||||
a1 = AxisDescriptor()
|
||||
@ -698,6 +699,7 @@ def test_rulesDocument(tmpdir):
|
||||
testDocPath = os.path.join(tmpdir, "testRules.designspace")
|
||||
testDocPath2 = os.path.join(tmpdir, "testRules_roundtrip.designspace")
|
||||
doc = DesignSpaceDocument()
|
||||
doc.rulesProcessingLast = True
|
||||
a1 = AxisDescriptor()
|
||||
a1.minimum = 0
|
||||
a1.maximum = 1000
|
||||
@ -741,6 +743,7 @@ def test_rulesDocument(tmpdir):
|
||||
_addUnwrappedCondition(testDocPath)
|
||||
doc2 = DesignSpaceDocument()
|
||||
doc2.read(testDocPath)
|
||||
assert doc2.rulesProcessingLast
|
||||
assert len(doc2.axes) == 2
|
||||
assert len(doc2.rules) == 1
|
||||
assert len(doc2.rules[0].conditionSets) == 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user