Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/test_conversion.py
blob: aa6f1a9c7d576b2db83cebb06690311304dc9a63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import unittest

from olpc.datastore.converter import converter
from StringIO import StringIO

class Test(unittest.TestCase):

    def test_unicode(self):
        # read each of the test files in doing conversion,
        # there should be no unicode errors
        fn_expectations = {
            'test.pdf' : 'Don\'t',
            'test.doc' : 'amazed.',
            'test.odt' : 'amazed.',
            'plugger.pdf' : 'Plugger',
            'funkyabi.odt' : 'vaca'
            }
        for fn, expect in fn_expectations.iteritems():
            assert expect in converter(fn).read()


        
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(Test))
    return suite

if __name__ == "__main__":
    unittest.main()