test_iso8601.py 文件源码

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

项目:deb-subunit 作者: openstack 项目源码 文件源码
def test_parse_no_timezone():
    """issue 4 - Handle datetime string without timezone

    This tests what happens when you parse a date with no timezone. While not
    strictly correct this is quite common. I'll assume UTC for the time zone
    in this case.
    """
    d = iso8601.parse_date("2007-01-01T08:00:00")
    assert d.year == 2007
    assert d.month == 1
    assert d.day == 1
    assert d.hour == 8
    assert d.minute == 0
    assert d.second == 0
    assert d.microsecond == 0
    assert d.tzinfo == iso8601.UTC
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号