예제 #1
0
    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())
예제 #2
0
 def testEmpty(self):
     emptyPath = Path()
     self.assertFalse(emptyPath.isConnected())
     self.assertEquals(emptyPath.length(), 0)