def testLength(self): p = Path() p.addPoint(self.p0) p.addPoint(self.p1) l0 = Line(self.p0, self.p1) l1 = Line(self.p1, self.p2) self.assertEquals(p.length(), l0.length()) p.addPoint(self.p2) self.assertEquals(p.length(), l0.length() + l1.length())
def testEmpty(self): emptyPath = Path() self.assertFalse(emptyPath.isConnected()) self.assertEquals(emptyPath.length(), 0)