Example #1
0
 def test_vertices(self):
     p1 = IntegerPoint(0, 0)
     p2 = IntegerPoint(2, 0)
     p3 = IntegerPoint(2, 2)
     p4 = IntegerPoint(0, 2)
     r1 = IntegerOrthoRectangle(p1, p3)
     self.assertTupleEqual(r1.vertices(), (p1, p2, p3, p4))
Example #2
0
 def test_sides(self):
     p1 = IntegerPoint(0, 0)
     p2 = IntegerPoint(2, 0)
     p3 = IntegerPoint(2, 2)
     p4 = IntegerPoint(0, 2)
     a = IntegerSegment(p1, p2)
     b = IntegerSegment(p2, p3)
     c = IntegerSegment(p3, p4)
     d = IntegerSegment(p4, p1)
     r1 = IntegerOrthoRectangle(p1, p3)
     self.assertTupleEqual(r1.sides(), (a, b, c, d))
Example #3
0
 def test_containing_pt_ct(self):
     p1 = IntegerPoint(0, 0)
     p3 = IntegerPoint(2, 2)
     r1 = IntegerOrthoRectangle(p1, p3)
     self.assertEqual(r1.containing_pt_ct(), 9)
Example #4
0
 def test_creation_from_tuple(self):
     r1 = IntegerOrthoRectangle(p1=(0, 0), p3=(2, 2))
     self.assertTupleEqual(r1.vertex_tuple(), ((0, 0), (2, 2)))