예제 #1
0
    def checkCalcDistance(self):
        print("Checking calcDistance...")

        p1 = Planet(1.0, 1.0, 3.0, 4.0, 5.0, "jupiter.gif")
        p2 = Planet(2.0, 1.0, 3.0, 4.0, 5.0, "jupiter.gif")
        p3 = Planet(4.0, 5.0, 3.0, 4.0, 5.0, "jupiter.gif")

        self.checkEquals(p1.calcDistance(p2), 1.0, "calcDistance()", 0.01)
        self.checkEquals(p1.calcDistance(p3), 5.0, "calcDistance()", 0.01)