本文整理汇总了Python中ics.icalendar.Calendar.events方法的典型用法代码示例。如果您正苦于以下问题:Python Calendar.events方法的具体用法?Python Calendar.events怎么用?Python Calendar.events使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ics.icalendar.Calendar
的用法示例。
在下文中一共展示了Calendar.events方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_empty_list_to_eventlist
# 需要导入模块: from ics.icalendar import Calendar [as 别名]
# 或者: from ics.icalendar.Calendar import events [as 别名]
def test_empty_list_to_eventlist(self):
c = Calendar()
l = []
c.events = l
self.assertIsNot(c.events, l)
self.assertIsInstance(c.events, EventList)
self.assertSequenceEqual(c.events, l)
示例2: test_list_to_eventlist
# 需要导入模块: from ics.icalendar import Calendar [as 别名]
# 或者: from ics.icalendar.Calendar import events [as 别名]
def test_list_to_eventlist(self):
c = Calendar()
l = [Event(), Event(), Event(name='plop')]
c.events = l
self.assertIsNot(c.events, l)
self.assertIsInstance(c.events, EventList)
self.assertSequenceEqual(c.events, l)
示例3: test_events_setter
# 需要导入模块: from ics.icalendar import Calendar [as 别名]
# 或者: from ics.icalendar.Calendar import events [as 别名]
def test_events_setter(self):
c = Calendar(cal1)
e = Event()
c.events = [e]
self.assertEqual(c.events, [e])
示例4: test_events_eventlist
# 需要导入模块: from ics.icalendar import Calendar [as 别名]
# 或者: from ics.icalendar.Calendar import events [as 别名]
def test_events_eventlist(self):
c = Calendar()
l = EventList()
e = Event()
l.append(e)
c.events = l
self.assertEqual(c.events, [e])
示例5: test_eventlist_is_same
# 需要导入模块: from ics.icalendar import Calendar [as 别名]
# 或者: from ics.icalendar.Calendar import events [as 别名]
def test_eventlist_is_same(self):
c = Calendar()
l = EventList()
c.events = l
self.assertIs(c.events, l)
示例6: test_events_set_string
# 需要导入模块: from ics.icalendar import Calendar [as 别名]
# 或者: from ics.icalendar.Calendar import events [as 别名]
def test_events_set_string(self):
c = Calendar(cal1)
e = "42"
with self.assertRaises(ValueError):
c.events = e
示例7: test_events_set_int
# 需要导入模块: from ics.icalendar import Calendar [as 别名]
# 或者: from ics.icalendar.Calendar import events [as 别名]
def test_events_set_int(self):
c = Calendar()
with self.assertRaises(ValueError):
c.events = 42