Example #1
0
 def test_doesnt_touch_edge_non_ortho(self):
     p1 = IntegerPoint(1, 1)
     edge = IntegerSegment((0, 0), (2, 4))
     self.assertFalse(p1.touches_edge(edge))
Example #2
0
 def test_default_initialization(self):
     p1 = IntegerPoint()
     self.assertTupleEqual(p1.tuple(), (0, 0))
Example #3
0
 def test_touches_edge_non_ortho(self):
     p1 = IntegerPoint(1, 2)
     edge = IntegerSegment((0, 0), (2, 4))
     self.assertTrue(p1.touches_edge(edge))
Example #4
0
 def test_tuple(self):
     p1 = IntegerPoint(0, 1)
     p2 = IntegerPoint(1, 1)
     res = IntegerSegment(p1, p2)
     self.assertTupleEqual(res.tuple(), (p1.tuple(), p2.tuple()))