Exemplo n.º 1
0
 def test_boundigBox(self):
     radius = random.uniform(0, 100)
     point = Point(random.uniform(0, 100), random.uniform(0, 100))
     r = point.boundingBox(radius)
     self.assertEqual(round(r.center().x() * 100), round(point.x() * 100))
     self.assertEqual(round(r.center().y() * 100), round(point.y() * 100))
     self.assertEqual(round(r.width() * 100), round(radius * 200))
     self.assertEqual(round(r.height() * 100), round(radius * 200))
Exemplo n.º 2
0
 def test_init(self):
     p = Point(1, 2)
     q = Point(p)
     r = Point((1, 2))
     self.assertEqual(q.x(), r.x())
     self.assertEqual(q.y(), r.y())