本文整理汇总了Python中ics.event.Event.make_all_day方法的典型用法代码示例。如果您正苦于以下问题:Python Event.make_all_day方法的具体用法?Python Event.make_all_day怎么用?Python Event.make_all_day使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ics.event.Event
的用法示例。
在下文中一共展示了Event.make_all_day方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_make_all_day
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import make_all_day [as 别名]
def test_make_all_day(self):
e = Event(begin=0, end=20)
begin = e.begin
e.make_all_day()
self.assertEqual(e.begin, begin)
self.assertEqual(e._end_time, None)
self.assertEqual(e._duration, None)
示例2: test_make_all_day
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import make_all_day [as 别名]
def test_make_all_day(self):
e = Event(begin=0, end=20)
begin = e.begin
e.make_all_day()
self.assertEqual(e.begin, begin.date())
self.assertEqual(e.end, begin.date())
self.assertEqual(e.duration, timedelta(1))
示例3: test_has_end
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import make_all_day [as 别名]
def test_has_end(self):
e = Event()
self.assertFalse(e.has_end())
e = Event(begin="1993/05/24", duration=10)
self.assertTrue(e.has_end())
e = Event(begin="1993/05/24", end="1999/10/11")
self.assertTrue(e.has_end())
e = Event(begin="1993/05/24")
e.make_all_day()
self.assertFalse(e.has_end())
示例4: test_all_day_outputs_dtstart_value_date
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import make_all_day [as 别名]
def test_all_day_outputs_dtstart_value_date(self):
"""All day events should output DTSTART using VALUE=DATE without
time and timezone in order to assume the user's current timezone
refs http://www.kanzaki.com/docs/ical/dtstart.html
http://www.kanzaki.com/docs/ical/date.html
"""
e = Event(begin="2015/12/21")
e.make_all_day()
# no time or tz specifier
self.assertIn('DTSTART;VALUE=DATE:20151221', str(e).splitlines())
示例5: test_make_all_day2
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import make_all_day [as 别名]
def test_make_all_day2(self):
e = Event(begin="1993/05/24")
begin = arrow.get("1993/05/24")
self.assertEqual(e._begin, begin)
self.assertEqual(e.begin, begin)
self.assertEqual(e._end_time, None)
self.assertEqual(e.end, begin)
e.make_all_day()
self.assertEqual(e._begin, begin)
self.assertEqual(e.begin, begin)
self.assertEqual(e._begin_precision, "day")
self.assertEqual(e._end_time, None)
self.assertEqual(e.end, arrow.get("1993/05/25"))
示例6: test_duration
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import make_all_day [as 别名]
def test_duration(self):
e = Event()
self.assertIsNone(e.duration)
e1 = Event(begin="1993/05/24")
e1.make_all_day()
self.assertEqual(e1.duration, timedelta(days=1))
e2 = Event(begin="1993/05/24", end="1993/05/30")
self.assertEqual(e2.duration, timedelta(days=6))
e3 = Event(begin="1993/05/24", duration=timedelta(minutes=1))
self.assertEqual(e3.duration, timedelta(minutes=1))
e4 = Event(begin="1993/05/24")
self.assertEqual(e4.duration, timedelta(seconds=1))
e5 = Event(begin="1993/05/24")
e5.duration = {'days': 6, 'hours': 2}
self.assertEqual(e5.end, arrow.get("1993/05/30T02:00"))
self.assertEqual(e5.duration, timedelta(hours=146))
示例7: test_all_day_repr
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import make_all_day [as 别名]
def test_all_day_repr(self):
e = Event(name='plop', begin="1999/10/10")
e.make_all_day()
self.assertEqual(repr(e), "<all-day Event 'plop' 1999-10-10>")