diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-03 17:13:59 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-03 17:13:59 (GMT) |
commit | 305c6b8fee224eed8095c87e386fc8ce2f4b6d36 (patch) | |
tree | bb49e0021c0765a89fa72d79e154d640b773a88a /Lib | |
parent | f964ac258e9b8e4d90ba158558a72d552fa75267 (diff) | |
download | cpython-305c6b8fee224eed8095c87e386fc8ce2f4b6d36.zip cpython-305c6b8fee224eed8095c87e386fc8ce2f4b6d36.tar.gz cpython-305c6b8fee224eed8095c87e386fc8ce2f4b6d36.tar.bz2 |
Since time.xmlrpc.com is unreliable, add another test to test_xmlrpc_net
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_xmlrpc_net.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Lib/test/test_xmlrpc_net.py b/Lib/test/test_xmlrpc_net.py index 56b74b2..c531b62 100644 --- a/Lib/test/test_xmlrpc_net.py +++ b/Lib/test/test_xmlrpc_net.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import collections import errno import socket import sys @@ -17,8 +18,7 @@ class CurrentTimeTest(unittest.TestCase): try: t0 = server.currentTime.getCurrentTime() except socket.error as e: - print(" test_current_time: skipping test, got error: %s" % e, - file=sys.stderr) + self.skipTest("network error: %s" % e) return # 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. 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.assertIsInstance(builders, collections.Sequence) + self.assertTrue([x for x in builders if "trunk" in x], builders) + def test_main(): support.requires("network") |