Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_mimetypes.Win32MimeTypesTestCase Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_registry_parsing

Public Attributes


Detailed Description

Definition at line 67 of file

Member Function Documentation

Definition at line 68 of file

00069     def setUp(self):
00070         # ensure all entries actually come from the Windows registry
00071         self.original_types_map = mimetypes.types_map.copy()
00072         mimetypes.types_map.clear()
00073         mimetypes.init()
00074         self.db = mimetypes.MimeTypes()

Here is the caller graph for this function:

Definition at line 75 of file

00076     def tearDown(self):
00077         # restore default settings
00078         mimetypes.types_map.clear()
00079         mimetypes.types_map.update(self.original_types_map)

Here is the caller graph for this function:

Definition at line 80 of file

00081     def test_registry_parsing(self):
00082         # the original, minimum contents of the MIME database in the
00083         # Windows registry is undocumented AFAIK.
00084         # Use file types that should *always* exist:
00085         eq = self.assertEqual
00086         eq(self.db.guess_type("foo.txt"), ("text/plain", None))

Here is the call graph for this function:

Member Data Documentation

Definition at line 73 of file

Definition at line 70 of file

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