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')
评论列表
文章目录