Mercurial > p > roundup > code
view test/test_textfmt.py @ 4878:f6e76a03b502
HTML* classes for cgi are now all new-style
Add regression test for old behaviour: Lookup of a value of a
HTMLProperty was possibly via getitem -- for old-style classes this
worked because __getattr__ returned the __getitem__ of a newly created
HTMLItem object, this does no longer work for new-style classes as these
look up special method only on the class not the instance.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Sat, 29 Mar 2014 10:52:20 +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
