Back to index

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

List of all members.

Public Member Functions

def test_content_type_err
def test_url_requests

Detailed Description

Tests for pydoc._url_handler

Definition at line 465 of file test_pydoc.py.


Member Function Documentation

Definition at line 468 of file test_pydoc.py.

00468 
00469     def test_content_type_err(self):
00470         f = pydoc._url_handler
00471         self.assertRaises(TypeError, f, 'A', '')
00472         self.assertRaises(TypeError, f, 'B', 'foobar')

Here is the call graph for this function:

Definition at line 473 of file test_pydoc.py.

00473 
00474     def test_url_requests(self):
00475         # Test for the correct title in the html pages returned.
00476         # This tests the different parts of the URL handler without
00477         # getting too picky about the exact html.
00478         requests = [
00479             ("", "Pydoc: Index of Modules"),
00480             ("get?key=", "Pydoc: Index of Modules"),
00481             ("index", "Pydoc: Index of Modules"),
00482             ("topics", "Pydoc: Topics"),
00483             ("keywords", "Pydoc: Keywords"),
00484             ("pydoc", "Pydoc: module pydoc"),
00485             ("get?key=pydoc", "Pydoc: module pydoc"),
00486             ("search?key=pydoc", "Pydoc: Search Results"),
00487             ("topic?key=def", "Pydoc: KEYWORD def"),
00488             ("topic?key=STRINGS", "Pydoc: TOPIC STRINGS"),
00489             ("foobar", "Pydoc: Error - foobar"),
00490             ("getfile?key=foobar", "Pydoc: Error - getfile?key=foobar"),
00491             ]
00492 
00493         for url, title in requests:
00494             text = pydoc._url_handler(url, "text/html")
00495             result = get_html_title(text)
00496             self.assertEqual(result, title)
00497 
00498         path = string.__file__
00499         title = "Pydoc: getfile " + path
00500         url = "getfile?key=" + path
00501         text = pydoc._url_handler(url, "text/html")
00502         result = get_html_title(text)
00503         self.assertEqual(result, title)
00504 

Here is the call graph for this function:


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