1 | n/a | import collections.abc |
---|
2 | n/a | import unittest |
---|
3 | n/a | from test import support |
---|
4 | n/a | |
---|
5 | n/a | import xmlrpc.client as xmlrpclib |
---|
6 | n/a | |
---|
7 | n/a | class PythonBuildersTest(unittest.TestCase): |
---|
8 | n/a | |
---|
9 | n/a | def test_python_builders(self): |
---|
10 | n/a | # Get the list of builders from the XMLRPC buildbot interface at |
---|
11 | n/a | # python.org. |
---|
12 | n/a | server = xmlrpclib.ServerProxy("http://buildbot.python.org/all/xmlrpc/") |
---|
13 | n/a | try: |
---|
14 | n/a | builders = server.getAllBuilders() |
---|
15 | n/a | except OSError as e: |
---|
16 | n/a | self.skipTest("network error: %s" % e) |
---|
17 | n/a | self.addCleanup(lambda: server('close')()) |
---|
18 | n/a | |
---|
19 | n/a | # Perform a minimal sanity check on the result, just to be sure |
---|
20 | n/a | # the request means what we think it means. |
---|
21 | n/a | self.assertIsInstance(builders, collections.abc.Sequence) |
---|
22 | n/a | self.assertTrue([x for x in builders if "3.x" in x], builders) |
---|
23 | n/a | |
---|
24 | n/a | |
---|
25 | n/a | def test_main(): |
---|
26 | n/a | support.requires("network") |
---|
27 | n/a | support.run_unittest(PythonBuildersTest) |
---|
28 | n/a | |
---|
29 | n/a | if __name__ == "__main__": |
---|
30 | n/a | test_main() |
---|