本文整理汇总了Python中schedule.periods.Period.get_persisted_occurrences方法的典型用法代码示例。如果您正苦于以下问题:Python Period.get_persisted_occurrences方法的具体用法?Python Period.get_persisted_occurrences怎么用?Python Period.get_persisted_occurrences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类schedule.periods.Period
的用法示例。
在下文中一共展示了Period.get_persisted_occurrences方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testPeriodFromPool
# 需要导入模块: from schedule.periods import Period [as 别名]
# 或者: from schedule.periods.Period import get_persisted_occurrences [as 别名]
def testPeriodFromPool(self):
"""
Test that period initiated with occurrence_pool returns the same occurrences as "straigh" period
in a corner case whereby a period's start date is equal to the occurrence's end date
"""
start = datetime.datetime(2008, 1, 5, 9, 0, tzinfo=pytz.utc)
end = datetime.datetime(2008, 1, 5, 10, 0, tzinfo=pytz.utc)
parent_period = Period(Event.objects.all(), start, end)
period = Period(parent_period.events, start, end, parent_period.get_persisted_occurrences(), parent_period.occurrences)
self.assertEqual(parent_period.occurrences, period.occurrences)