[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser/tests - __init__.py:1.1.2.1 testAttributePublisher.py:1.1.2.1
Jim Fulton
jim@zope.com
Fri, 16 Nov 2001 17:08:33 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv30375/tests
Added Files:
Tag: Zope-3x-branch
__init__.py testAttributePublisher.py
Log Message:
Added AttributePublisher
=== Added File Zope3/lib/python/Zope/Publisher/Browser/tests/__init__.py ===
=== Added File Zope3/lib/python/Zope/Publisher/Browser/tests/testAttributePublisher.py ===
import unittest, sys
from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
class Presentation(AttributePublisher):
def index(self): return 'index'
def action(self): return 'action'
class Test(unittest.TestCase):
def testItAll(self):
o=Presentation()
self.assertEquals(o.browser_default(None), 'index.html')
self.assertEquals(o.browser_traverse(None, 'index.html')(), 'index')
self.assertEquals(o.browser_traverse(None, 'index')(), 'index')
self.assertEquals(o.browser_traverse(None, 'action.html')(), 'action')
self.assertEquals(o.browser_traverse(None, 'action')(), 'action')
def test_suite():
loader=unittest.TestLoader()
return loader.loadTestsFromTestCase(Test)
if __name__=='__main__':
unittest.TextTestRunner().run(test_suite())