view test/test_textfmt.py @ 4498:8df9492c2746

Fix file-unlink bug in mailgw (Ralfs oversight when refactoring the mail gateway code) -- if a message is sent that contains no attachments, all previous files of the issue are unlinked, thanks to Rafal Bisingier for reporting and proposing a fix. I've now added a regression test that catches this issue.
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Sun, 29 May 2011 18:25:49 +0000
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/