boundsPen_test: test single-point contours, with/without 'ignoreSinglePoints'

This commit is contained in:
Cosimo Lupo 2016-01-07 15:48:23 +00:00
parent dc2ef2e341
commit 974421e8b0

View File

@ -61,6 +61,16 @@ class ControlBoundsPenTest(unittest.TestCase):
pen.qCurveTo((6, 6), (10, 0))
self.assertEqual("0 0 10 6", bounds_(pen))
def test_singlePoint(self):
pen = ControlBoundsPen(None)
pen.moveTo((-5, 10))
self.assertEqual("-5 10 -5 10", bounds_(pen))
def test_ignoreSinglePoint(self):
pen = ControlBoundsPen(None, ignoreSinglePoints=True)
pen.moveTo((0, 10))
self.assertEqual(None, pen.bounds)
if __name__ == '__main__':
unittest.main()