def test_nonempty_intersection2(self): p1 = period(date(day=1, month=2, year=2008), date(day=28, month=2, year=2008)) p2 = period(date(day=26, month=2, year=2008), date(day=28, month=2, year=2009)) self.assertEqual(timedelta(days=3), p1.intersection(p2))
def test_sous_ensemble(self): p1 = period(date(day=1, month=2, year=2008), date(day=28, month=2, year=2009)) p2 = period(date(day=1, month=4, year=2008), date(day=3, month=4, year=2008)) self.assertEqual(timedelta(days=3), p1.intersection(p2))
def test_disjoins2(self): p1 = period(date(day=1, month=2, year=2008), date(day=28, month=2, year=2008)) p2 = period(date(day=1, month=2, year=2008), date(day=28, month=2, year=2009)) self.assertFalse(p1.disjoin(p2))