def test_includes_disjoined(self): # disjoined events event_a = Event(name='Test #1', begin=dt(2016, 6, 10, 20, 10), duration=td(minutes=20)) event_b = Event(name='Test #2', begin=dt(2016, 6, 10, 20, 50), duration=td(minutes=20)) assert not event_a.includes(event_b) assert not event_b.includes(event_a)
def test_includes_included(self): # included events event_a = Event(name='Test #1', begin=dt(2016, 6, 10, 20, 00), duration=td(minutes=60)) event_b = Event(name='Test #2', begin=dt(2016, 6, 10, 20, 10), duration=td(minutes=30)) assert event_a.includes(event_b) assert not event_b.includes(event_a) event_a = Event(name='Test #1', begin=dt(2016, 6, 10, 20, 10), duration=td(minutes=30)) event_b = Event(name='Test #2', begin=dt(2016, 6, 10, 20, 00), duration=td(minutes=60)) assert not event_a.includes(event_b) assert event_b.includes(event_a)
def test_includes(self): # disjoined events event_a = Event(name='Test #1', begin=dt(2016, 6, 10, 20, 10), duration=td(minutes=20)) event_b = Event(name='Test #2', begin=dt(2016, 6, 10, 20, 50), duration=td(minutes=20)) assert False == event_a.includes(event_b) assert False == event_b.includes(event_a) # intersected events event_a = Event(name='Test #1', begin=dt(2016, 6, 10, 20, 10), duration=td(minutes=30)) event_b = Event(name='Test #2', begin=dt(2016, 6, 10, 20, 30), duration=td(minutes=30)) assert False == event_a.includes(event_b) assert False == event_b.includes(event_a) event_a = Event(name='Test #1', begin=dt(2016, 6, 10, 20, 30), duration=td(minutes=30)) event_b = Event(name='Test #2', begin=dt(2016, 6, 10, 20, 10), duration=td(minutes=30)) assert False == event_a.includes(event_b) assert False == event_b.includes(event_a) # included events event_a = Event(name='Test #1', begin=dt(2016, 6, 10, 20, 00), duration=td(minutes=60)) event_b = Event(name='Test #2', begin=dt(2016, 6, 10, 20, 10), duration=td(minutes=30)) assert True == event_a.includes(event_b) assert False == event_b.includes(event_a) event_a = Event(name='Test #1', begin=dt(2016, 6, 10, 20, 10), duration=td(minutes=30)) event_b = Event(name='Test #2', begin=dt(2016, 6, 10, 20, 00), duration=td(minutes=60)) assert False == event_a.includes(event_b) assert True == event_b.includes(event_a)