Back to index

plone3  3.1.7
Public Member Functions
Archetypes.tests.test_baseunit.BaseUnitTest Class Reference
Inheritance diagram for Archetypes.tests.test_baseunit.BaseUnitTest:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.test_baseunit.BaseUnitTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testSame

Detailed Description

Definition at line 40 of file test_baseunit.py.


Member Function Documentation

Definition at line 42 of file test_baseunit.py.

00042 
00043     def testSame(self):
00044         gen_dummy()
00045         # The BaseUnit expects 'instance' to be
00046         # acquisition wrapped, or else it does return
00047         # the untransformed text -- this was introduced
00048         # for compatibility with APE.
00049         parent = Dummy(oid='parent')
00050         dummy = Dummy(oid='dummy', init_transforms=1).__of__(parent)
00051         input = open(self.input)
00052         bu = BaseUnit(name='test', file=input,
00053                       mimetype='text/restructured',
00054                       instance=dummy)
00055         input.close()
00056         got = normalize_html(bu.transform(dummy, 'text/html'))
00057         
00058         try:
00059             output = open(self.output)
00060         except IOError:
00061             print "Creating %s" % self.output
00062             output = open(self.output, 'w')
00063             output.write(got)
00064             output.close()
00065             
00066         output = open(self.output)
00067         expected = normalize_html(output.read())
00068         output.close()
00069     
00070         try:
00071             self.assertEqual(got, expected)
00072         except self.failureException:
00073             # Zope < 2.8 has a buggy reStructuredText package, don't bother
00074             if ZOPE28:
00075                 raise

Here is the call graph for this function:


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