[Python-checkins] r76088 - python/branches/py3k/Lib/test/test_xmlrpc_net.py

antoine.pitrou python-checkins at python.org
Tue Nov 3 18:14:00 CET 2009


Author: antoine.pitrou
Date: Tue Nov  3 18:13:59 2009
New Revision: 76088

Log:
Since time.xmlrpc.com is unreliable, add another test to test_xmlrpc_net



Modified:
   python/branches/py3k/Lib/test/test_xmlrpc_net.py

Modified: python/branches/py3k/Lib/test/test_xmlrpc_net.py
==============================================================================
--- python/branches/py3k/Lib/test/test_xmlrpc_net.py	(original)
+++ python/branches/py3k/Lib/test/test_xmlrpc_net.py	Tue Nov  3 18:13:59 2009
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+import collections
 import errno
 import socket
 import sys
@@ -17,8 +18,7 @@
         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 @@
         # 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")


More information about the Python-checkins mailing list