pens_test.py: fix test failure with latest defcon

somehow the segmentType of the first move point of a contour is a unicode string now, and the test was comparing the repr...
This commit is contained in:
Cosimo Lupo 2018-09-05 19:20:37 +01:00
parent 486e774a4f
commit 7dbe476f64
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482
2 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,8 @@ class _TestPenMixin(object):
PointPen test cases, plus some helper methods. PointPen test cases, plus some helper methods.
""" """
maxDiff = None
def diff(self, expected, actual): def diff(self, expected, actual):
import difflib import difflib
expected = str(self.Glyph(expected)).splitlines(True) expected = str(self.Glyph(expected)).splitlines(True)

View File

@ -50,7 +50,7 @@ class DummyPointPen(BaseDummyPen):
self.commands.append(('endPath', tuple(), {})) self.commands.append(('endPath', tuple(), {}))
def addPoint(self, pt, segmentType=None, smooth=False, name=None, **kwargs): def addPoint(self, pt, segmentType=None, smooth=False, name=None, **kwargs):
kwargs['segmentType'] = segmentType kwargs['segmentType'] = str(segmentType) if segmentType else None
kwargs['smooth'] = smooth kwargs['smooth'] = smooth
kwargs['name'] = name kwargs['name'] = name
self.commands.append(('addPoint', (pt,), kwargs)) self.commands.append(('addPoint', (pt,), kwargs))