예제 #1
0
 def setUp(self):
     logging.disable(logging.CRITICAL)
     self.longMessage = True
     pointA = PointElement(2, 2, 2)
     pointB = PointElement(6, 1, 4)
     pointC = PointElement(4, 6, 3)
     points = [pointA, pointB, pointC]
     self.p_col = PointCollection(*points)
예제 #2
0
 def test_min(self):
     pointMin = PointElement(2, 1, 2)
     self.assertEqual(self.p_col.min, pointMin)
예제 #3
0
 def test_avg(self):
     pointAvg = PointElement(4, 3, 3)
     self.assertEqual(self.p_col.average, pointAvg)
예제 #4
0
 def test_attributes(self):
     self.assertEqual(self.p_col.points[0], PointElement(2, 2, 2))
예제 #5
0
 def test_max(self):
     pointMax = PointElement(6, 6, 4)
     self.assertEqual(self.p_col.max, pointMax)
예제 #6
0
 def setUp(self):
     self.pointA = PointElement(2,2,2)
     self.pointB = PointElement(10,6,0)
예제 #7
0
 def test_sub(self):
     pointSub = self.pointB - self.pointA
     sub_result = PointElement(8, 4, -2)
     self.assertEqual(pointSub, sub_result)
예제 #8
0
 def test_add(self):
     pointSum = self.pointA + self.pointB
     sum_result = PointElement(12, 8, 2)
     self.assertEqual(pointSum, sum_result)
예제 #9
0
 def test_init(self):
     point = PointElement()
     self.assertEqual(point.as_tuple, (0,0,0))
예제 #10
0
 def test_eq(self):
     pointA = PointElement(2, 2, 2)
     pointB = PointElement(2, 2, 2)
     pointC = PointElement(0, 0, 0)
     self.assertEqual(pointA, pointB)
     self.assertNotEqual(pointA, pointC)