ยปCore Development>Code coverage>Lib/test/test_xmlrpc_net.py

Python code coverage for Lib/test/test_xmlrpc_net.py

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