Back to index

python3.2  3.2.2
Public Member Functions
test.test_xmlrpc_net.CurrentTimeTest Class Reference

List of all members.

Public Member Functions

def test_current_time
def test_python_builders

Detailed Description

Definition at line 12 of file test_xmlrpc_net.py.


Member Function Documentation

Definition at line 14 of file test_xmlrpc_net.py.

00014 
00015     def test_current_time(self):
00016         # Get the current time from xmlrpc.com.  This code exercises
00017         # the minimal HTTP functionality in xmlrpclib.
00018         server = xmlrpclib.ServerProxy("http://time.xmlrpc.com/RPC2")
00019         try:
00020             t0 = server.currentTime.getCurrentTime()
00021         except socket.error as e:
00022             self.skipTest("network error: %s" % e)
00023             return
00024 
00025         # Perform a minimal sanity check on the result, just to be sure
00026         # the request means what we think it means.
00027         t1 = xmlrpclib.DateTime()
00028 
00029         dt0 = xmlrpclib._datetime_type(t0.value)
00030         dt1 = xmlrpclib._datetime_type(t1.value)
00031         if dt0 > dt1:
00032             delta = dt0 - dt1
00033         else:
00034             delta = dt1 - dt0
00035         # The difference between the system time here and the system
00036         # time on the server should not be too big.
00037         self.assertTrue(delta.days <= 1)

Here is the call graph for this function:

Definition at line 38 of file test_xmlrpc_net.py.

00038 
00039     def test_python_builders(self):
00040         # Get the list of builders from the XMLRPC buildbot interface at
00041         # python.org.
00042         self.skipTest("XMLRPC interface removed in Buildbot 0.8.2")
00043         server = xmlrpclib.ServerProxy("http://www.python.org/dev/buildbot/all/xmlrpc/")
00044         try:
00045             builders = server.getAllBuilders()
00046         except socket.error as e:
00047             self.skipTest("network error: %s" % e)
00048             return
00049 
00050         # Perform a minimal sanity check on the result, just to be sure
00051         # the request means what we think it means.
00052         self.assertIsInstance(builders, collections.Sequence)
00053         self.assertTrue([x for x in builders if "3.x" in x], builders)
00054 

Here is the call graph for this function:


The documentation for this class was generated from the following file: