view test/test_textfmt.py @ 4579:ba4c632143f6

issue2550535 Fix keep_quoted_text=yes setting. In some cases even when keep_quoted_text=yes is configured we would strip quoted sections. This hit the python bug-tracker especially for python interpreter examples with leading '>>>' strings. The fix is slightly different compared to the proposal as this broke keep_quoted_text=no in certain cases. We also fix a bug where keep_quoted_text=no would drop the last line of a non-quoted section if there wasn't an empty line between the next quotes.
author Ralf Schlatterbeck <rsc@runtux.com>
date Thu, 05 Jan 2012 20:55:47 +0100
parents f35ece8f8ff7
children 364c54991861
line wrap: on
line source

import unittest

from roundup.support import wrap

class WrapTestCase(unittest.TestCase):
    def testWrap(self):
        lorem = '''Lorem ipsum dolor sit amet, consectetuer adipiscing elit.'''
        wrapped = '''Lorem ipsum dolor
sit amet,
consectetuer
adipiscing elit.'''
        self.assertEquals(wrap(lorem, 20), wrapped)

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

Roundup Issue Tracker: http://roundup-tracker.org/