当前位置: 首页>>代码示例>>Python>>正文


Python Event.intersects方法代码示例

本文整理汇总了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)
开发者ID:C4ptainCrunch,项目名称:ics.py,代码行数:13,代码来源:event.py

示例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)
开发者ID:guyzmo,项目名称:ics.py,代码行数:26,代码来源:event.py

示例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)
开发者ID:C4ptainCrunch,项目名称:ics.py,代码行数:8,代码来源:event.py


注:本文中的ics.event.Event.intersects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。