예제 #1
0
파일: event.py 프로젝트: tomschr/ics.py
 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)
예제 #2
0
파일: event.py 프로젝트: Timic3/ics.py
    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)
예제 #3
0
    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)
예제 #4
0
 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)
예제 #5
0
파일: event.py 프로젝트: guyzmo/ics.py
 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)
예제 #6
0
 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)