Back to index

python3.2  3.2.2
Public Member Functions
test.test_pydoc.PydocServerTest Class Reference

List of all members.

Public Member Functions

def test_server

Detailed Description

Tests for pydoc._start_server

Definition at line 442 of file test_pydoc.py.


Member Function Documentation

Definition at line 445 of file test_pydoc.py.

00445 
00446     def test_server(self):
00447 
00448         # Minimal test that starts the server, then stops it.
00449         def my_url_handler(url, content_type):
00450             text = 'the URL sent was: (%s, %s)' % (url, content_type)
00451             return text
00452 
00453         serverthread = pydoc._start_server(my_url_handler, port=0)
00454         starttime = time.time()
00455         timeout = 1  #seconds
00456 
00457         while serverthread.serving:
00458             time.sleep(.01)
00459             if serverthread.serving and time.time() - starttime > timeout:
00460                 serverthread.stop()
00461                 break
00462 
00463         self.assertEqual(serverthread.error, None)
00464 

Here is the call graph for this function:


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