Did I find the right examples for you? yes no

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)

src/z/o/zope.app.zptpage-3.5.1/src/zope/app/zptpage/tests/test_zptpage.py   zope.app.zptpage(Download)
from zope.app.zptpage.zptpage import ZPTPage, ZPTSourceView,\
     ZPTReadFile, ZPTWriteFile, ZPTFactory
from zope.app.zptpage.zptpage import Sized
 
 
    def test_zeroSized(self):
        s = Sized(DummyZPT(''))
        self.assertEqual(s.sizeForSorting(), ('line', 0))
        self.assertEqual(s.sizeForDisplay(), u'${lines} lines')
        self.assertEqual(s.sizeForDisplay().mapping, {'lines': '0'})
 
    def test_oneSized(self):
        s = Sized(DummyZPT('one line'))
    def test_arbitrarySize(self):
        s = Sized(DummyZPT('some line\n'*5))
        self.assertEqual(s.sizeForSorting(), ('line', 5))
        self.assertEqual(s.sizeForDisplay(), u'${lines} lines')
        self.assertEqual(s.sizeForDisplay().mapping, {'lines': '5'})