Back to index

plone3  3.1.7
test_graph.py
Go to the documentation of this file.
00001 
00002 from Testing import ZopeTestCase
00003 from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
00004 
00005 from utils import input_file_path
00006 FILE_PATH = input_file_path("demo1.pdf")
00007 
00008 class TestGraph(ATSiteTestCase):
00009 
00010     def afterSetUp(self):
00011         ATSiteTestCase.afterSetUp(self)
00012         self.engine = self.portal.portal_transforms
00013 
00014     def testGraph(self):
00015         ### XXX Local file and expected output
00016         data = open(FILE_PATH, 'r').read()
00017         out = self.engine.convertTo('text/plain', data, filename=FILE_PATH)
00018         assert(out.getData())
00019 
00020     def testIdentity(self):
00021         orig = 'Some text'
00022         converted = self.engine.convertTo(
00023             'text/plain', 'Some text', mimetype='text/plain')
00024         self.assertEquals(orig, str(converted))
00025 
00026 
00027 def test_suite():
00028     from unittest import TestSuite, makeSuite
00029     suite = TestSuite()
00030     suite.addTest(makeSuite(TestGraph))
00031     return suite