[Zope3-checkins] CVS: Zope3/src/zope/app/traversing/tests - test_directives.py:1.1 traversing.zcml:1.1 test_namespacetrversal.py:1.8

Stephan Richter srichter@cosmos.phy.tufts.edu
Sat, 2 Aug 2003 14:17:34 -0400


Update of /cvs-repository/Zope3/src/zope/app/traversing/tests
In directory cvs.zope.org:/tmp/cvs-serv13715/tests

Modified Files:
	test_namespacetrversal.py 
Added Files:
	test_directives.py traversing.zcml 
Log Message:
Converted traversalNamespace ZCML directive. Added a test for it too.


=== Added File Zope3/src/zope/app/traversing/tests/test_directives.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 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.
#
##############################################################################
"""Test the traversalNamespace directive.

$Id: test_directives.py,v 1.1 2003/08/02 18:17:28 srichter Exp $
"""
import unittest

from zope.app.traversing.namespace import _namespace_handlers 
from zope.configuration import xmlconfig
import zope.app.traversing.tests

class Handler:
    pass
  
class DirectivesTest(unittest.TestCase):

    def test_traversalNamespace(self):
        self.assertEqual(_namespace_handlers.get('test', None), None)
        self.context = xmlconfig.file("traversing.zcml",
                                      zope.app.traversing.tests)
        self.assertEqual(_namespace_handlers.get('test'), Handler)


def test_suite():
    return unittest.TestSuite((
        unittest.makeSuite(DirectivesTest),
        ))

if __name__ == '__main__':
    unittest.main()


=== Added File Zope3/src/zope/app/traversing/tests/traversing.zcml ===
<configure xmlns="http://namespaces.zope.org/zope">

  <include package="zope.app.traversing" file="meta.zcml"/>
 
  <traversalNamespace
      name="test"
      handler=".test_directives.Handler" />

</configure>


=== Zope3/src/zope/app/traversing/tests/test_namespacetrversal.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/traversing/tests/test_namespacetrversal.py:1.7	Sun Jun  1 11:59:38 2003
+++ Zope3/src/zope/app/traversing/tests/test_namespacetrversal.py	Sat Aug  2 14:17:28 2003
@@ -11,9 +11,8 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##############################################################################
-"""
+"""Traversal Namespace Tests
 
-Revision information:
 $Id$
 """