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