test_ip_v4.py 文件源码

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

项目:Taigabot 作者: FrozenPigs 项目源码 文件源码
def test_ipaddress_inet_pton_constructor_v4():
    with pytest.raises(AddrFormatError):
        IPAddress('0177.01', flags=INET_PTON)

    with pytest.raises(AddrFormatError):
        IPAddress('0x7f.0.01', flags=INET_PTON)

    with pytest.raises(AddrFormatError):
        IPAddress('10', flags=INET_PTON)

    with pytest.raises(AddrFormatError):
        IPAddress('10.1', flags=INET_PTON)

    with pytest.raises(AddrFormatError):
        IPAddress('10.0.1', flags=INET_PTON)

    assert IPAddress('10.0.0.1', flags=INET_PTON) == IPAddress('10.0.0.1')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号