Пример #1
0
 def test_invalid_input(self):
     with self.assertRaises(ValueError):
         line_overlap(('wow', 'nice'), ('asd', 'www'))
         line_overlap((2, 3, 1), (2, 3))
         line_overlap(('5.1', 2), (1, 0.6))
         line_overlap((None, None), (1, 2))
         line_overlap([0.1, 5.1], (0, 0.2))
Пример #2
0
 def test_overlap_l2_greater(self):
     self.assertEqual(line_overlap((1, 5), (2, 6)), True)
     self.assertEqual(line_overlap((1.4, 5.1), (2, 6)), True)
     self.assertEqual(line_overlap((-3, 5), (0, 6)), True)
     self.assertEqual(line_overlap((0, 1), (-3, 3)), True)
Пример #3
0
 def test_overlap_l1_greater(self):
     self.assertEqual(line_overlap((2, 6), (1, 5)), True)
     self.assertEqual(line_overlap((0, 5.1), (-1, 1)), True)
Пример #4
0
 def test_not_overlap(self):
     self.assertEqual(line_overlap((0, 1), (2, 6)), False)
     self.assertEqual(line_overlap((1.4, 5.1), (5.6, 6)), False)
Пример #5
0
 def test_overlap_l2_contained(self):
     self.assertEqual(line_overlap((-0, 0), (0, 6)), True)
Пример #6
0
 def test_overlap_l1_contained(self):
     self.assertEqual(line_overlap((1.4, 5.1), (2.2, 4.7)), True)
     self.assertEqual(line_overlap((2.3, 5.1), (2.3, 2.4)), True)