Exemplo n.º 1
0
    def test_pageSplit(self):
        
        testdata = u"""
This is the first page.
And this is too.
[#改ページ]
Second page.
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
12345678901234567890
1234567890
This should be page three.
[#改ページ]

This should be page four.
"""
        
        paragraphs = Parser.parseParagraphs(testdata)
        pages = Parser.pageSplit(paragraphs)

        self.assertEqual(pages[0][0], u"This is the first page.")
        self.assertEqual(pages[1][0], u"Second page.")
        self.assertEqual(pages[2][0], u"This should be page three.")
        self.assertEqual(pages[3][0], u"This should be page four.")