def test_find_intersection_of_float_ranges_one_inside_other(self):
     r1 = Range(10, 40)
     r2 = Range(20, 30)
     intersection = r1.intersection(r2)
     intersection2 = r2.intersection(r1)
     expected = (20, 30)
     self.assertEqual(intersection.range, expected)
     self.assertEqual(intersection2.range, expected)
 def test_find_intersection_of_identical_float_ranges(self):
     r1 = Range(10, 20)
     r2 = Range(10, 20)
     intersection = r1.intersection(r2)
     intersection2 = r2.intersection(r1)
     expected = (10, 20)
     self.assertEqual(intersection.range, expected)
     self.assertEqual(intersection2.range, expected)
 def test_find_intersection_of_overlapping_float_ranges(self):
     r1 = Range(0, 10)
     r2 = Range(5, 15)
     intersection = r1.intersection(r2)
     intersection2 = r2.intersection(r1)
     expected = (5, 10)
     self.assertEqual(intersection.range, expected)
     self.assertEqual(intersection2.range, expected)
 def test_find_intersection_of_separate_float_ranges(self):
     r1 = Range(0, 10)
     r2 = Range(20, 30)
     intersection = r1.intersection(r2)
     intersection2 = r2.intersection(r1)
     expected = None
     self.assertEqual(intersection.range, expected)
     self.assertEqual(intersection2.range, expected)
 def test_intersection_of_empty_float_ranges(self):
     r1 = Range()
     r2 = Range()
     intersection = r1.intersection(r2)
     intersection2 = r2.intersection(r1)
     expected = None
     self.assertEqual(intersection.range, expected)
     self.assertEqual(intersection2.range, expected)
 def test_find_intersection_of_two_ranges(self):
     r1 = Range(0, 10)
     r2 = Range(6, 12)
     intersection = r1.intersection(r2)
     intersection2 = r2.intersection(r1)
     expected = (6, 10)
     self.assertEqual(intersection.range, expected)
     self.assertEqual(intersection2.range, expected)
 def test_find_intersection_of_just_touching_float_ranges(self):
     r1 = Range(10, 20)
     r2 = Range(20, 30)
     intersection = r1.intersection(r2)
     intersection2 = r2.intersection(r1)
     expected = (20, 20)
     self.assertEqual(intersection.range, expected)
     self.assertEqual(intersection2.range, expected)