Giampaolo Rodola' <[email protected]> added the comment:
I think the main problem here is that it's not easy to write reliable tests
that work across all platforms (getaddrinfo(host, 'ftp') returning UDP
addresses on FreeBSD/Qemu only is an example).
We might try to go a little deeper as you suggested but it's very likely that
some buildbots turn red, IMHO.
> One example of this: test the 'family' flag by looking for
> www.google.com with both AF_INET and AF_INET6 and then check that the
> first returns IPv4 information and the second IPv6.
This is already done, although for IPv4 only and by using localhost instead of
google.com.
infos = socket.getaddrinfo(HOST, None, socket.AF_INET)
for family, _, _, _, _ in infos:
self.assertEqual(family, socket.AF_INET)
I'm attaching a new patch which adds some additional checks.
Feel free to extend it, if you want.
----------
Added file: http://bugs.python.org/file18543/getaddrtests.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue8857>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com