def _getStroke(self): point = Point() point.x = 1 point.y = 2 point.timestamp = 3 point2 = Point() point2.x = 4 point2.y = 5 point2.pressure = 0.1 stroke = Stroke() stroke.append_point(point) stroke.append_point(point2) return stroke
def _getWriting(self): point = Point() point.x = 1 point.y = 2 point.timestamp = 3 point2 = Point() point2.x = 4 point2.y = 5 point2.pressure = 0.1 stroke = Stroke() stroke.append_point(point) stroke.append_point(point2) writing = Writing() writing.append_stroke(stroke) return writing
def testDuration(self): point = Point() point.x = 1 point.y = 2 point.timestamp = 0 point2 = Point() point2.x = 4 point2.y = 5 point2.timestamp = 5 stroke = Stroke() stroke.append_point(point) stroke.append_point(point2) point3 = Point() point3.x = 1 point3.y = 2 point3.timestamp = 7 point4 = Point() point4.x = 4 point4.y = 5 point4.timestamp = 10 stroke2 = Stroke() stroke2.append_point(point3) stroke2.append_point(point4) self.assertEquals(stroke2.get_duration(), 3) writing = Writing() writing.append_stroke(stroke) writing.append_stroke(stroke2) self.assertEquals(writing.get_duration(), 10)
def _getPoint(self): point = Point() point.x = 1 point.y = 2 point.timestamp = 3 return point