view test/test_textfmt.py @ 3882:46ef2a6fd79d

config option to limit nosy attachments based on size reworking of patch [SF#772323] from Philipp Gortan It tries to avoid reading the file contents just to get the file size but that was too hard for metakit backends. They don't inherit from blobfiles.FileStorage which makes it more challenging. Really that backend should be reworked to inherit from FileStorage. I'm not sure I like the default being sys.maxint. Maybe have 0 == unlimited? But what if someone really wanted to set it to 0 to mean "don't attach anything"?
author Justus Pendleton <jpend@users.sourceforge.net>
date Mon, 03 Sep 2007 17:14:09 +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/