Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
test.test_xmlrpc.MultiPathServerTestCase Class Reference
Inheritance diagram for test.test_xmlrpc.MultiPathServerTestCase:
Inheritance graph
[legend]
Collaboration diagram for test.test_xmlrpc.MultiPathServerTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_path1
def test_path2
def setUp
def tearDown

Public Attributes

 evt

Static Public Attributes

tuple threadFunc = staticmethod(http_multi_server)
int request_count = 2
 requestHandler = None

Detailed Description

Definition at line 587 of file test_xmlrpc.py.


Member Function Documentation

def test.test_xmlrpc.BaseServerTestCase.setUp (   self) [inherited]

Reimplemented in test.test_xmlrpc.GzipServerTestCase, and test.test_xmlrpc.BaseKeepaliveServerTestCase.

Definition at line 424 of file test_xmlrpc.py.

00424 
00425     def setUp(self):
00426         # enable traceback reporting
00427         xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = True
00428 
00429         self.evt = threading.Event()
00430         # start server thread to handle requests
00431         serv_args = (self.evt, self.request_count, self.requestHandler)
00432         threading.Thread(target=self.threadFunc, args=serv_args).start()
00433 
00434         # wait for the server to be ready
00435         self.evt.wait()
00436         self.evt.clear()

Here is the caller graph for this function:

Definition at line 437 of file test_xmlrpc.py.

00437 
00438     def tearDown(self):
00439         # wait on the server thread to terminate
00440         self.evt.wait(4.0)
00441         # XXX this code does not work, and in fact stop_serving doesn't exist.
00442         if not self.evt.is_set():
00443             self.evt.set()
00444             stop_serving()
00445             raise RuntimeError("timeout reached, test has failed")
00446 
00447         # disable traceback reporting
00448         xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = False

Here is the caller graph for this function:

Definition at line 590 of file test_xmlrpc.py.

00590 
00591     def test_path1(self):
00592         p = xmlrpclib.ServerProxy(URL+"/foo")
00593         self.assertEqual(p.pow(6,8), 6**8)
        self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)

Here is the call graph for this function:

Definition at line 594 of file test_xmlrpc.py.

00594 
00595     def test_path2(self):
00596         p = xmlrpclib.ServerProxy(URL+"/foo/bar")
00597         self.assertEqual(p.add(6,8), 6+8)
00598         self.assertRaises(xmlrpclib.Fault, p.pow, 6, 8)
00599 
00600 #A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism
#does indeed serve subsequent requests on the same connection

Here is the call graph for this function:


Member Data Documentation

Definition at line 428 of file test_xmlrpc.py.

Reimplemented from test.test_xmlrpc.BaseServerTestCase.

Definition at line 589 of file test_xmlrpc.py.

Definition at line 420 of file test_xmlrpc.py.

Reimplemented from test.test_xmlrpc.BaseServerTestCase.

Definition at line 588 of file test_xmlrpc.py.


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