[Zope-Checkins] CVS: Zope3/lib/python/Zope/PageTemplate/tests - SimpleTestView.py:1.1.2.1 testSimpleViewClass.pt:1.1.2.1 testSimpleViewClass.py:1.1.2.1

Andreas Jung andreas@digicool.com
Thu, 10 Jan 2002 15:29:27 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/PageTemplate/tests
In directory cvs.zope.org:/tmp/cvs-serv31471/tests

Added Files:
      Tag: Zope-3x-branch
	SimpleTestView.py testSimpleViewClass.pt 
	testSimpleViewClass.py 
Log Message:
- added tests for SimpleViewClass
- made SImpleViewClass callable
- made SImpleViewCLass instances into macro collections


=== Added File Zope3/lib/python/Zope/PageTemplate/tests/SimpleTestView.py ===

from Zope.PageTemplate import SimpleViewClass

SimpleTestView = SimpleViewClass('testSimpleViewClass.pt')


=== Added File Zope3/lib/python/Zope/PageTemplate/tests/testSimpleViewClass.pt ===
<html>
  <body>
    <p metal:define-macro="test">hello world</p>
  </body>
</html>


=== Added File Zope3/lib/python/Zope/PageTemplate/tests/testSimpleViewClass.py ===
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# 
##############################################################################

import unittest, sys



class data: pass

class Test(unittest.TestCase):

    def test(self):
        from SimpleTestView import SimpleTestView
        
        ob = data()
        view = SimpleTestView(ob)        
        macro = view['test']
        view()
 

def test_suite():
    loader=unittest.TestLoader()
    return loader.loadTestsFromTestCase(Test)

if __name__=='__main__':
    unittest.TextTestRunner().run(test_suite())