Back to index

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

List of all members.

Classes

class  RequestHandler
class  Transport

Public Member Functions

def setUp
def test_gzip_request
def test_bad_gzip_request
def test_gsip_response
def tearDown

Public Attributes

 evt

Static Public Attributes

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

Detailed Description

Definition at line 678 of file test_xmlrpc.py.


Member Function Documentation

Reimplemented from test.test_xmlrpc.BaseServerTestCase.

Definition at line 704 of file test_xmlrpc.py.

00704 
00705     def setUp(self):
00706         BaseServerTestCase.setUp(self)

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

00719 
00720     def test_bad_gzip_request(self):
00721         t = self.Transport()
00722         t.encode_threshold = None
00723         t.fake_gzip = True
00724         p = xmlrpclib.ServerProxy(URL, transport=t)
00725         cm = self.assertRaisesRegex(xmlrpclib.ProtocolError,
00726                                     re.compile(r"\b400\b"))
00727         with cm:
00728             p.pow(6, 8)
00729         p("close")()

Here is the call graph for this function:

Definition at line 730 of file test_xmlrpc.py.

00730 
00731     def test_gsip_response(self):
00732         t = self.Transport()
00733         p = xmlrpclib.ServerProxy(URL, transport=t)
00734         old = self.requestHandler.encode_threshold
00735         self.requestHandler.encode_threshold = None #no encoding
00736         self.assertEqual(p.pow(6,8), 6**8)
00737         a = t.response_length
00738         self.requestHandler.encode_threshold = 0 #always encode
00739         self.assertEqual(p.pow(6,8), 6**8)
00740         p("close")()
00741         b = t.response_length
00742         self.requestHandler.encode_threshold = old
00743         self.assertTrue(a>b)
00744 
#Test special attributes of the ServerProxy object

Here is the call graph for this function:

Definition at line 707 of file test_xmlrpc.py.

00707 
00708     def test_gzip_request(self):
00709         t = self.Transport()
00710         t.encode_threshold = None
00711         p = xmlrpclib.ServerProxy(URL, transport=t)
00712         self.assertEqual(p.pow(6,8), 6**8)
00713         a = self.RequestHandler.content_length
00714         t.encode_threshold = 0 #turn on request encoding
00715         self.assertEqual(p.pow(6,8), 6**8)
00716         b = self.RequestHandler.content_length
00717         self.assertTrue(a>b)
00718         p("close")()

Here is the call graph for this function:


Member Data Documentation

Definition at line 428 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: