tests.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:python-card-me 作者: tBaxter 项目源码 文件源码
def test_vtimezone_creation(self):
        tzs = dateutil.tz.tzical("test_files/timezones.ics")
        pacific = icalendar.TimezoneComponent(tzs.get('US/Pacific'))
        self.assertEqual(
            str(pacific),
            "<VTIMEZONE | <TZID{}US/Pacific>>"
        )
        santiago = icalendar.TimezoneComponent(tzs.get('Santiago'))
        self.assertEqual(
            str(santiago),
            "<VTIMEZONE | <TZID{}Santiago>>"
        )
        for year in range(2001, 2010):
            for month in (2, 9):
                dt = datetime.datetime(year, month, 15, tzinfo = tzs.get('Santiago'))
                #if dt.replace(tzinfo=tzs.get('Santiago')) != dt:
                self.assertTrue(dt.replace(tzinfo=tzs.get('Santiago')), dt)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号