2010-03-12 06:53:45 +08:00
|
|
|
#!/usr/bin/env python3
|
2007-08-15 00:47:39 +08:00
|
|
|
|
2011-02-23 08:46:28 +08:00
|
|
|
import collections.abc
|
2008-03-24 13:51:45 +08:00
|
|
|
import errno
|
|
|
|
import socket
|
|
|
|
import sys
|
2007-08-15 00:47:39 +08:00
|
|
|
import unittest
|
2008-05-21 05:35:26 +08:00
|
|
|
from test import support
|
2007-08-15 00:47:39 +08:00
|
|
|
|
2008-05-27 00:32:26 +08:00
|
|
|
import xmlrpc.client as xmlrpclib
|
2007-08-15 00:47:39 +08:00
|
|
|
|
2013-10-12 00:09:51 +08:00
|
|
|
class PythonBuildersTest(unittest.TestCase):
|
2007-08-15 00:47:39 +08:00
|
|
|
|
2009-11-04 01:13:59 +08:00
|
|
|
def test_python_builders(self):
|
|
|
|
# Get the list of builders from the XMLRPC buildbot interface at
|
|
|
|
# python.org.
|
2012-06-25 02:06:54 +08:00
|
|
|
server = xmlrpclib.ServerProxy("http://buildbot.python.org/all/xmlrpc/")
|
2009-11-04 01:13:59 +08:00
|
|
|
try:
|
|
|
|
builders = server.getAllBuilders()
|
2012-12-19 05:10:48 +08:00
|
|
|
except OSError as e:
|
2009-11-04 01:13:59 +08:00
|
|
|
self.skipTest("network error: %s" % e)
|
|
|
|
return
|
2011-11-29 04:14:46 +08:00
|
|
|
self.addCleanup(lambda: server('close')())
|
2009-11-04 01:13:59 +08:00
|
|
|
|
|
|
|
# Perform a minimal sanity check on the result, just to be sure
|
|
|
|
# the request means what we think it means.
|
2011-02-23 08:46:28 +08:00
|
|
|
self.assertIsInstance(builders, collections.abc.Sequence)
|
2010-07-06 06:11:16 +08:00
|
|
|
self.assertTrue([x for x in builders if "3.x" in x], builders)
|
2009-11-04 01:13:59 +08:00
|
|
|
|
2007-08-15 00:47:39 +08:00
|
|
|
|
|
|
|
def test_main():
|
2008-05-21 05:35:26 +08:00
|
|
|
support.requires("network")
|
2013-10-12 00:09:51 +08:00
|
|
|
support.run_unittest(PythonBuildersTest)
|
2007-08-15 00:47:39 +08:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
test_main()
|