Back to index

moin  1.9.0~rc2
Public Member Functions
test_filter.TestFilters Class Reference

List of all members.

Public Member Functions

def make_file
def testBinaryGeneric
def testTextGeneric
def testTextHtml
def testTextXml

Detailed Description

Definition at line 12 of file test_filter.py.


Member Function Documentation

def test_filter.TestFilters.make_file (   self,
  data 
)

Definition at line 14 of file test_filter.py.

00014 
00015     def make_file(self, data):
00016         import tempfile
00017         fname = tempfile.mktemp()
00018         f = file(fname, 'wb')
00019         f.write(data)
00020         f.close()
00021         return fname

Here is the caller graph for this function:

Definition at line 22 of file test_filter.py.

00022 
00023     def testBinaryGeneric(self):
00024         from MoinMoin.filter.application_octet_stream import execute as _filter
00025         tests = [('', ''),
00026                  ('this\x00is\x00a\x00test\x00', u'this test'), # throws away short stuff
00027                 ]
00028         for data, expected in tests:
00029             fname = self.make_file(data)
00030             assert _filter(None, fname) == expected

Here is the call graph for this function:

Definition at line 31 of file test_filter.py.

00031 
00032     def testTextGeneric(self):
00033         from MoinMoin.filter.text import execute as _filter
00034         tests = [('', ''),
00035                  ('asdf\r\nghjk', u'asdf\r\nghjk'),
00036                  # add some tests with umlauts in diff. encodings
00037                 ]
00038         for data, expected in tests:
00039             fname = self.make_file(data)
00040             assert _filter(None, fname) == expected

Here is the call graph for this function:

Definition at line 41 of file test_filter.py.

00041 
00042     def testTextHtml(self):
00043         from MoinMoin.filter.text_html import execute as _filter
00044         tests = [('', ''),
00045                  ('<html><body>Hello<br>World!</body></html>', u'Hello World!'),
00046                 ]
00047         for data, expected in tests:
00048             fname = self.make_file(data)
00049             assert _filter(None, fname) == expected

Here is the call graph for this function:

Definition at line 50 of file test_filter.py.

00050 
00051     def testTextXml(self):
00052         from MoinMoin.filter.text_xml import execute as _filter
00053         tests = [('', ''),
00054                  ('<xml><para>Hello</para><para>World!</para></xml>', u'Hello World!'),
00055                 ]
00056         for data, expected in tests:
00057             fname = self.make_file(data)
00058             assert _filter(None, fname) == expected

Here is the call graph for this function:


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