Back to index

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

List of all members.

Public Member Functions

def test_close
def test_transport
def setUp
def tearDown

Public Attributes

 evt

Static Public Attributes

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

Detailed Description

Definition at line 644 of file test_xmlrpc.py.


Member Function Documentation

Reimplemented from test.test_xmlrpc.BaseServerTestCase.

Definition at line 618 of file test_xmlrpc.py.

00618 
00619     def setUp(self):
00620         #clear request log
00621         self.RequestHandler.myRequests = []
00622         return BaseServerTestCase.setUp(self)
00623 
00624 #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 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 648 of file test_xmlrpc.py.

00648 
00649     def test_close(self):
00650         p = xmlrpclib.ServerProxy(URL)
00651         #do some requests with close.
00652         self.assertEqual(p.pow(6,8), 6**8)
00653         self.assertEqual(p.pow(6,8), 6**8)
00654         self.assertEqual(p.pow(6,8), 6**8)
00655         p("close")() #this should trigger a new keep-alive request
00656         self.assertEqual(p.pow(6,8), 6**8)
00657         self.assertEqual(p.pow(6,8), 6**8)
00658         self.assertEqual(p.pow(6,8), 6**8)
00659         p("close")()
00660 
00661         #they should have all been two request handlers, each having logged at least
00662         #two complete requests
00663         self.assertEqual(len(self.RequestHandler.myRequests), 2)
00664         self.assertGreaterEqual(len(self.RequestHandler.myRequests[-1]), 2)
00665         self.assertGreaterEqual(len(self.RequestHandler.myRequests[-2]), 2)
00666 

Here is the call graph for this function:

Definition at line 667 of file test_xmlrpc.py.

00667 
00668     def test_transport(self):
00669         p = xmlrpclib.ServerProxy(URL)
00670         #do some requests with close.
00671         self.assertEqual(p.pow(6,8), 6**8)
00672         p("transport").close() #same as above, really.
00673         self.assertEqual(p.pow(6,8), 6**8)
00674         p("close")()
00675         self.assertEqual(len(self.RequestHandler.myRequests), 2)
00676 
00677 #A test case that verifies that gzip encoding works in both directions
#(for a request and the response)

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 646 of file test_xmlrpc.py.

Definition at line 420 of file test_xmlrpc.py.

Reimplemented in test.test_xmlrpc.MultiPathServerTestCase.

Definition at line 422 of file test_xmlrpc.py.


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