Пример #1
0
 def test_addComponent_decomposed(self):
     pen = DecomposingRecordingPen({"a": _TestGlyph()})
     pen.addComponent("a", (2, 0, 0, 3, -10, 5))
     assert pen.value == [
         ('moveTo', ((-10.0, 5.0),)),
         ('lineTo', ((-10.0, 305.0),)),
         ('curveTo', ((90.0, 230.0), (110.0, 155.0), (90.0, 5.0),)),
         ('closePath', ())]
Пример #2
0
 def test_addComponent_decomposed(self):
     pen = DecomposingRecordingPen({"a": _TestGlyph()})
     pen.addComponent("a", (2, 0, 0, 3, -10, 5))
     assert pen.value == [
         ("moveTo", ((-10.0, 5.0), )),
         ("lineTo", ((-10.0, 305.0), )),
         ("curveTo", ((90.0, 230.0), (110.0, 155.0), (90.0, 5.0))),
         ("closePath", ()),
     ]
Пример #3
0
 def test_addComponent_missing_raises(self):
     pen = DecomposingRecordingPen(dict())
     with pytest.raises(KeyError) as excinfo:
         pen.addComponent("a", (1, 0, 0, 1, 0, 0))
     assert excinfo.value.args[0] == "a"
Пример #4
0
 def test_addComponent_missing_raises(self):
     pen = DecomposingRecordingPen(dict())
     with pytest.raises(KeyError) as excinfo:
         pen.addComponent("a", (1, 0, 0, 1, 0, 0))
     assert excinfo.value.args[0] == "a"