parameters: (HandlerClass = BaseHTTPRequestHandler,
           ServerClass = HTTPServer, protocol="HTTP/1.0")
docstring: Test the HTTP request handler class.
  
      This runs an HTTP server on port 8000 (or the first command line
      argument).
docstring_summary: Test the HTTP request handler class.
docstring_tokens: Test the HTTP request handler class .
function: def test(HandlerClass = BaseHTTPRequestHandler,
           ServerClass = HTTPServer, protocol="HTTP/1.0"):
      """Test the HTTP request handler class.
  
      This runs an HTTP server on port 8000 (or the first command line
      argument).
  
      """
  
      if sys.argv[1:]:
          port = int(sys.argv[1])
      else:
          port = 8000
      server_address = ('', port)
  
      HandlerClass.protocol_version = protocol
      httpd = ServerClass(server_address, HandlerClass)
  
      sa = httpd.socket.getsockname()
      print ("Serving HTTP on", sa[0], "port", sa[1], "...")
      httpd.serve_forever()
function_tokens: def test ( HandlerClass = BaseHTTPRequestHandler , ServerClass = HTTPServer , protocol = "HTTP/1.0" ) : if sys . argv [ 1 : ] : port = int ( sys . argv [ 1 ] ) else : port = 8000 server_address = ( '' , port ) HandlerClass . protocol_version = protocol httpd = ServerClass ( server_address , HandlerClass ) sa = httpd . socket . getsockname ( ) print ( "Serving HTTP on" , sa [ 0 ] , "port" , sa [ 1 ] , "..." ) httpd . serve_forever ( )