[Zope3-checkins] CVS: Zope3/src/zope/app/onlinehelp/tests - test_helpdirectives.py:1.4
Jim Fulton
jim@zope.com
Mon, 28 Jul 2003 18:21:05 -0400
Update of /cvs-repository/Zope3/src/zope/app/onlinehelp/tests
In directory cvs.zope.org:/tmp/cvs-serv29869/src/zope/app/onlinehelp/tests
Modified Files:
test_helpdirectives.py
Log Message:
Changed to use new configuration api
=== Zope3/src/zope/app/onlinehelp/tests/test_helpdirectives.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/onlinehelp/tests/test_helpdirectives.py:1.3 Tue Jul 15 10:20:15 2003
+++ Zope3/src/zope/app/onlinehelp/tests/test_helpdirectives.py Mon Jul 28 18:20:30 2003
@@ -18,12 +18,10 @@
import os
import unittest
-from cStringIO import StringIO
-
from zope.interface import Interface
from zope.component.adapter import provideAdapter
from zope.component.tests.placelesssetup import PlacelessSetup
-from zope.configuration.xmlconfig import xmlconfig, Context, XMLConfig
+from zope.configuration import xmlconfig
from zope.app.interfaces.traversing import \
ITraverser, ITraversable, IPhysicallyLocatable
from zope.app.traversing.adapters import \
@@ -51,20 +49,19 @@
provideAdapter(None, ITraverser, Traverser)
provideAdapter(None, ITraversable, DefaultTraversable)
provideAdapter(None, IPhysicallyLocatable, WrapperPhysicallyLocatable)
- XMLConfig('meta.zcml', zope.app.onlinehelp)()
+ self.context = xmlconfig.file('meta.zcml', zope.app.onlinehelp)
def test_register(self):
self.assertEqual(help.keys(), [])
- xmlconfig(StringIO(template % (
+ xmlconfig.string(template % (
'''
<help:register
id = "help1"
title = "Help"
for = "zope.app.onlinehelp.tests.test_helpdirectives.I1"
view = "view.html"
- doc_path = "./help.txt" />
- '''
- )), None, Context([], zope.i18n.tests))
+ doc_path = "tests/help.txt" />
+ '''), self.context)
self.assertEqual(help.keys(), ['help1'])
self.assertEqual(help._registry[(I1, 'view.html')][0].title, 'Help')
help._register = {}
@@ -76,11 +73,10 @@
help.registerHelpTopic('', 'help', 'Help',
path, 'txt', I1, 'view.html')
- xmlconfig(StringIO(template % (
+ xmlconfig.string(template % (
'''
<help:unregister path="help" />
- '''
- )), None, Context([], zope.i18n.tests))
+ '''), self.context)
self.assertEqual(help.keys(), [])