本文整理汇总了Python中ics.event.Event.intersects方法的典型用法代码示例。如果您正苦于以下问题:Python Event.intersects方法的具体用法?Python Event.intersects怎么用?Python Event.intersects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ics.event.Event
的用法示例。
在下文中一共展示了Event.intersects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_intersects_included
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import intersects [as 别名]
def test_intersects_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.intersects(event_b)
assert event_b.intersects(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 event_a.intersects(event_b)
assert event_b.intersects(event_a)
示例2: test_intersects
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import intersects [as 别名]
def test_intersects(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.intersects(event_b)
assert False == event_b.intersects(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 True == event_a.intersects(event_b)
assert True == event_b.intersects(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 True == event_a.intersects(event_b)
assert True == event_b.intersects(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.intersects(event_b)
assert True == event_b.intersects(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 True == event_a.intersects(event_b)
assert True == event_b.intersects(event_a)
示例3: test_intersects_disjoined
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import intersects [as 别名]
def test_intersects_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.intersects(event_b)
assert not event_b.intersects(event_a)