Merged revisions 76088 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r76088 | antoine.pitrou | 2009-11-03 18:13:59 +0100 (mar., 03 nov. 2009) | 3 lines

  Since time.xmlrpc.com is unreliable, add another test to test_xmlrpc_net
........
This commit is contained in:
Antoine Pitrou 2009-11-03 17:18:48 +00:00
parent 7e86664825
commit 180221f06a
1 changed files with 17 additions and 2 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
import collections
import errno import errno
import socket import socket
import sys import sys
@ -17,8 +18,7 @@ class CurrentTimeTest(unittest.TestCase):
try: try:
t0 = server.currentTime.getCurrentTime() t0 = server.currentTime.getCurrentTime()
except socket.error as e: except socket.error as e:
print(" test_current_time: skipping test, got error: %s" % e, self.skipTest("network error: %s" % e)
file=sys.stderr)
return return
# Perform a minimal sanity check on the result, just to be sure # Perform a minimal sanity check on the result, just to be sure
@ -35,6 +35,21 @@ class CurrentTimeTest(unittest.TestCase):
# time on the server should not be too big. # time on the server should not be too big.
self.assertTrue(delta.days <= 1) self.assertTrue(delta.days <= 1)
def test_python_builders(self):
# Get the list of builders from the XMLRPC buildbot interface at
# python.org.
server = xmlrpclib.ServerProxy("http://www.python.org/dev/buildbot/all/xmlrpc/")
try:
builders = server.getAllBuilders()
except socket.error as e:
self.skipTest("network error: %s" % e)
return
# Perform a minimal sanity check on the result, just to be sure
# the request means what we think it means.
self.assertTrue(isinstance(builders, collections.Sequence), type(builders))
self.assertTrue([x for x in builders if "trunk" in x], builders)
def test_main(): def test_main():
support.requires("network") support.requires("network")