Author: Amaury Forgeot d'Arc <amaur...@gmail.com> Branch: Changeset: r44181:1c70274f6eed Date: 2011-05-15 18:13 +0200 http://bitbucket.org/pypy/pypy/changeset/1c70274f6eed/
Log: Move socket tests away from codespeak.net diff --git a/pypy/module/_socket/test/test_sock_app.py b/pypy/module/_socket/test/test_sock_app.py --- a/pypy/module/_socket/test/test_sock_app.py +++ b/pypy/module/_socket/test/test_sock_app.py @@ -372,11 +372,12 @@ def test_socket_connect(self): import _socket, os s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM, 0) - # XXX temporarily we use codespeak to test, will have more robust tests in - # the absence of a network connection later when more parts of the socket - # API are implemented. currently skip the test if there is no connection. + # XXX temporarily we use python.org to test, will have more robust tests + # in the absence of a network connection later when more parts of the + # socket API are implemented. Currently skip the test if there is no + # connection. try: - s.connect(("codespeak.net", 80)) + s.connect(("www.python.org", 80)) except _socket.gaierror, ex: skip("GAIError - probably no connection: %s" % str(ex.args)) name = s.getpeername() # Will raise socket.error if not connected @@ -506,11 +507,12 @@ # Test that send/sendall/sendto accept a buffer or a unicode as arg import _socket, os s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM, 0) - # XXX temporarily we use codespeak to test, will have more robust tests in - # the absence of a network connection later when more parts of the socket - # API are implemented. currently skip the test if there is no connection. + # XXX temporarily we use python.org to test, will have more robust tests + # in the absence of a network connection later when more parts of the + # socket API are implemented. Currently skip the test if there is no + # connection. try: - s.connect(("codespeak.net", 80)) + s.connect(("www.python.org", 80)) except _socket.gaierror, ex: skip("GAIError - probably no connection: %s" % str(ex.args)) s.send(buffer('')) diff --git a/pypy/module/_ssl/test/test_ssl.py b/pypy/module/_ssl/test/test_ssl.py --- a/pypy/module/_ssl/test/test_ssl.py +++ b/pypy/module/_ssl/test/test_ssl.py @@ -90,8 +90,8 @@ cls.space = space def setup_method(self, method): - # https://codespeak.net/ - ADDR = "codespeak.net", 443 + # https://www.verisign.net/ + ADDR = "www.verisign.net", 443 self.w_s = self.space.appexec([self.space.wrap(ADDR)], """(ADDR): import socket diff --git a/pypy/rlib/test/test_rsocket.py b/pypy/rlib/test/test_rsocket.py --- a/pypy/rlib/test/test_rsocket.py +++ b/pypy/rlib/test/test_rsocket.py @@ -297,24 +297,25 @@ e = py.test.raises(GAIError, getaddrinfo, 'www.very-invalidaddress.com', None) assert isinstance(e.value.get_msg(), str) -def test_getaddrinfo_codespeak(): - lst = getaddrinfo('codespeak.net', None) +def test_getaddrinfo_pydotorg(): + lst = getaddrinfo('python.org', None) assert isinstance(lst, list) found = False for family, socktype, protocol, canonname, addr in lst: - if addr.get_host() == '88.198.193.90': + if addr.get_host() == '82.94.164.162': found = True assert found, lst def test_getaddrinfo_no_reverse_lookup(): # It seems that getaddrinfo never runs a reverse lookup on Linux. # Python2.3 on Windows returns the hostname. - lst = getaddrinfo('213.239.226.252', None, flags=AI_NUMERICHOST) + lst = getaddrinfo('82.94.164.162', None, flags=AI_NUMERICHOST) assert isinstance(lst, list) found = False + print lst for family, socktype, protocol, canonname, addr in lst: - assert canonname != 'codespeak.net' - if addr.get_host() == '213.239.226.252': + assert 'python.org' not in canonname + if addr.get_host() == '82.94.164.162': found = True assert found, lst _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit