Commit 27c7fd4c authored by Gabriel Monnerat's avatar Gabriel Monnerat

add test to pdf handler and remove code duplicated

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@43583 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e4970419
......@@ -29,7 +29,7 @@
import unittest
from cloudooo.handler.pdf.handler import PDFHandler
from cloudooo.handler.tests.handlerTestCase import HandlerTestCase
from cloudooo.handler.tests.handlerTestCase import HandlerTestCase, make_suite
from types import DictType
......@@ -67,6 +67,4 @@ class TestPDFHandler(HandlerTestCase):
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestPDFHandler))
return suite
return make_suite(TestPDFHandler)
......@@ -60,6 +60,16 @@ class TestServer(HandlerTestCase):
self.assertEquals(metadata["title"],
'Free Cloud Alliance Presentation')
def testSetMetadata(self):
"""Test if metadata is inserted correctly in document"""
data = open(join('data', 'test.pdf'), 'r').read()
new_data = self.proxy.updateFileMetadata(encodestring(data),
"pdf",
{"producer": "Cloudooo"})
metadata = self.proxy.getFileMetadataItemList(new_data, "pdf")
self.assertEquals(metadata["title"],
'Free Cloud Alliance Presentation')
self.assertEquals(metadata["producer"], 'Cloudooo')
def test_suite():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment