Back to index

plone3  3.1.7
Classes | Functions | Variables
kupu.plone.tests.test_html2captioned Namespace Reference

Classes

class  TransformTest

Functions

def input_file_path
def output_file_path
def make_tests
def test_suite

Variables

 IDataStream = None
tuple PREFIX = abspath(dirname(__file__))
tuple tests
 TR_NAMES = None

Function Documentation

Definition at line 20 of file test_html2captioned.py.

00020 
00021 def input_file_path(file):
00022     return join(PREFIX, 'input', file)

Here is the caller graph for this function:

generate tests classes from test info

return the list of generated test classes

Definition at line 88 of file test_html2captioned.py.

00088 
00089 def make_tests(test_descr):
00090     """generate tests classes from test info
00091 
00092     return the list of generated test classes
00093     """
00094     tests = []
00095     for _transform, tr_input, tr_output, _normalize, _subobjects in test_descr:
00096         # load transform if necessary
00097         if type(_transform) is type(''):
00098             try:
00099                 _transform = load(_transform).register()
00100             except:
00101                 import traceback
00102                 traceback.print_exc()
00103                 continue
00104         #
00105         if TR_NAMES is not None and not _transform.name() in TR_NAMES:
00106             print 'skip test for', _transform.name()
00107             continue
00108 
00109         class TransformTestSubclass(TransformTest):
00110             input = input_file_path(tr_input)
00111             output = output_file_path(tr_output)
00112             transform = _transform
00113             normalize = lambda x, y: _normalize(y)
00114             subobjects = _subobjects
00115 
00116         tests.append(TransformTestSubclass)
00117 
00118     return tests

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 23 of file test_html2captioned.py.

00023 
00024 def output_file_path(file):
00025     return join(PREFIX, 'output', file)

Here is the caller graph for this function:

Definition at line 119 of file test_html2captioned.py.

00119 
00120 def test_suite():
00121     t = [ (_transform,
00122         input_file_path(tr_input),
00123         output_file_path(tr_output),
00124         _normalize,
00125         _subobjects)
00126         for _transform, tr_input, tr_output, _normalize, _subobjects in tests ]
00127         
00128     return TestSuite([makeSuite(test) for test in make_tests(t)])

Here is the call graph for this function:


Variable Documentation

Definition at line 14 of file test_html2captioned.py.

tuple kupu.plone.tests.test_html2captioned.PREFIX = abspath(dirname(__file__))

Definition at line 18 of file test_html2captioned.py.

Initial value:
00001 (
00002 ('Products.kupu.plone.html2captioned', "minimal.in", "minimal.out", normalize_html, 0),
00003 ('Products.kupu.plone.html2captioned', "simple.in", "simple.out", normalize_html, 0),
00004 ('Products.kupu.plone.html2captioned', "baduid.in", "baduid.out", normalize_html, 0),
00005 ('Products.kupu.plone.html2captioned', "notquoted.in", "notquoted.out", normalize_html, 0),
00006 ('Products.kupu.plone.html2captioned', "notcaptioned.in", "notcaptioned.out", normalize_html, 0),
00007 ('Products.kupu.plone.html2captioned', "linked.in", "linked.out", normalize_html, 0),
00008 ('Products.kupu.plone.html2captioned', "umlauts.in", "umlauts.out", normalize_html, 0),
00009 ('Products.kupu.plone.html2captioned', "umlauts2.in", "umlauts2.out", normalize_html, 0),
00010     )

Definition at line 26 of file test_html2captioned.py.

Definition at line 86 of file test_html2captioned.py.