[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Traversing/tests - testSkin.py:1.1 testNamespaceTrversal.py:1.3
Jim Fulton
jim@zope.com
Fri, 12 Jul 2002 15:29:03 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/Traversing/tests
In directory cvs.zope.org:/tmp/cvs-serv21500/lib/python/Zope/App/Traversing/tests
Modified Files:
testNamespaceTrversal.py
Added Files:
testSkin.py
Log Message:
Finally added a configuration directive for registering traversal
namespace handlers:
<traversalNamespace name="etc" handler=".EtcNamespace.etc" />
Added a "skin" namespace so you can play with Sidbei's new UI work
by adding ++skin++ZopeTop to the front of your URLs:
http://localhost:8080/++skin++ZopeTop
Added some needed __init__ modules to some of the new ZopeTop packages
and fixed up ZopeTop configure.zcml.
=== Added File Zope3/lib/python/Zope/App/Traversing/tests/testSkin.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
#
##############################################################################
"""
Revision information:
$Id: testSkin.py,v 1.1 2002/07/12 19:28:33 jim Exp $
"""
from unittest import TestCase, TestSuite, main, makeSuite
from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
from Zope.Publisher.Browser.BrowserRequest import TestRequest
class Test(CleanUp, TestCase):
def test(self):
from Zope.App.Traversing.SkinNamespace import skin
request = TestRequest()
self.assertEqual(request.getPresentationSkin(), '')
ob = object()
ob2 = skin('foo', (), '++skin++foo', ob, request)
self.assertEqual(ob, ob2)
self.assertEqual(request.getPresentationSkin(), 'foo')
def test_suite():
return TestSuite((
makeSuite(Test),
))
if __name__=='__main__':
main(defaultTest='test_suite')
=== Zope3/lib/python/Zope/App/Traversing/tests/testNamespaceTrversal.py 1.2 => 1.3 ===
class Test(CleanUp, TestCase):
+ def setUp(self):
+ from Zope.App.Traversing.Namespaces import provideNamespaceHandler
+ from Zope.App.Traversing.AttrItemNamespaces import attr, item
+ provideNamespaceHandler('attribute', attr)
+ provideNamespaceHandler('item', item)
+
+
def testAttr(self):
from Zope.App.Traversing.Traverser import Traverser
traverser = Traverser(c)