Ejemplo n.º 1
0
    def test_range_one_equals_range_two(self):
        dateRange2 = dates.DateRange(self.now, self.seven_days_future)
        dateRange1 = dates.DateRange(self.now, self.seven_days_future)
        expected = dates.DateRange(self.now, self.seven_days_future)
        actual = dates.find_overlap(dateRange1, dateRange2)

        self.assertEqual(expected.begin, actual.begin)
        self.assertEqual(expected.end, actual.end)
Ejemplo n.º 2
0
    def test_range_two_extends_into_range_one(self):
        dateRange2 = dates.DateRange(self.seven_days_ago,
                                     self.seven_days_future)
        dateRange1 = dates.DateRange(self.now, self.fourteen_days_future)
        expected = dates.DateRange(self.now, self.seven_days_future)
        actual = dates.find_overlap(dateRange1, dateRange2)

        self.assertEqual(expected.begin, actual.begin)
        self.assertEqual(expected.end, actual.end)
Ejemplo n.º 3
0
 def test_range_two_does_not_overlap_with_range_one(self):
     dateRange2 = dates.DateRange(self.seven_days_ago, self.now)
     dateRange1 = dates.DateRange(self.seven_days_future,
                                  self.fourteen_days_future)
     self.assertRaises(Exception, dates.find_overlap, dateRange1,
                       dateRange2)
Ejemplo n.º 4
0
 def test_range_two_ends_at_range_one_begin(self):
     dateRange2 = dates.DateRange(self.seven_days_ago, self.now)
     dateRange1 = dates.DateRange(self.now, self.fourteen_days_future)
     self.assertRaises(Exception, dates.find_overlap, dateRange1,
                       dateRange2)