[Zope3-checkins] CVS: Zope3/src/zope/app/onlinehelp/tests - help.zcml:1.1 test_helpdirectives.py:1.5 test_onlinehelp.py:1.4

Stephan Richter srichter@cosmos.phy.tufts.edu
Sat, 2 Aug 2003 07:19:30 -0400


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

Modified Files:
	test_helpdirectives.py test_onlinehelp.py 
Added Files:
	help.zcml 
Log Message:
Converted 'help' ZCML namespace to new style. All tests and ftests pass.


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

  <include package="zope.app.onlinehelp" file="meta.zcml"/>

  <help:register 
      id = "help1"
      title = "Help"
      for = ".test_helpdirectives.I1"
      view = "view.html"
      doc_path = "help.txt" />

</configure>


=== Zope3/src/zope/app/onlinehelp/tests/test_helpdirectives.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/onlinehelp/tests/test_helpdirectives.py:1.4	Mon Jul 28 18:20:30 2003
+++ Zope3/src/zope/app/onlinehelp/tests/test_helpdirectives.py	Sat Aug  2 07:19:25 2003
@@ -15,28 +15,19 @@
 
 $Id$
 """
-import os
 import unittest
 
-from zope.interface import Interface
-from zope.component.adapter import provideAdapter
-from zope.component.tests.placelesssetup import PlacelessSetup
-from zope.configuration import xmlconfig
 from zope.app.interfaces.traversing import \
      ITraverser, ITraversable, IPhysicallyLocatable
+from zope.app.onlinehelp import tests
+from zope.app.onlinehelp import help
 from zope.app.traversing.adapters import \
      Traverser, DefaultTraversable, WrapperPhysicallyLocatable
+from zope.component.adapter import provideAdapter
+from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.configuration import xmlconfig
+from zope.interface import Interface
 
-import zope.app.onlinehelp
-from zope.app.onlinehelp import help
-from zope.app.onlinehelp.tests.test_onlinehelptopic import testdir
-
-template = """<zopeConfigure
-   xmlns='http://namespaces.zope.org/zope'
-   xmlns:help='http://namespaces.zope.org/help'>
-   xmlns:test='http://www.zope.org/NS/Zope3/test'>
-   %s
-   </zopeConfigure>"""
 
 class I1(Interface):
     pass
@@ -49,40 +40,18 @@
         provideAdapter(None, ITraverser, Traverser)
         provideAdapter(None, ITraversable, DefaultTraversable)
         provideAdapter(None, IPhysicallyLocatable, WrapperPhysicallyLocatable)
-        self.context = xmlconfig.file('meta.zcml', zope.app.onlinehelp)
 
     def test_register(self):
         self.assertEqual(help.keys(), [])
-        xmlconfig.string(template % (
-            '''
-              <help:register 
-                  id = "help1"
-                  title = "Help"
-                  for = "zope.app.onlinehelp.tests.test_helpdirectives.I1"
-                  view = "view.html"
-                  doc_path = "tests/help.txt" />
-                  '''), self.context)
+        self.context = xmlconfig.file("help.zcml", tests)
         self.assertEqual(help.keys(), ['help1'])
         self.assertEqual(help._registry[(I1, 'view.html')][0].title, 'Help')
-        help._register = {}
-        del help['help1']
-
-    def test_unregister(self):
-        self.assertEqual(help.keys(), [])
-        path = os.path.join(testdir(), 'help.txt')
-        help.registerHelpTopic('', 'help', 'Help',
-                               path, 'txt', I1, 'view.html')
-
-        xmlconfig.string(template % (
-            '''
-              <help:unregister path="help" />
-              '''), self.context)
-        self.assertEqual(help.keys(), [])
-
 
 
 def test_suite():
-    return unittest.makeSuite(DirectivesTest)
+    return unittest.TestSuite((
+        unittest.makeSuite(DirectivesTest),
+        ))
 
 if __name__ == '__main__':
-    unittest.TextTestRunner().run(test_suite())
+    unittest.main()


=== Zope3/src/zope/app/onlinehelp/tests/test_onlinehelp.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/onlinehelp/tests/test_onlinehelp.py:1.3	Tue Jul 15 10:20:15 2003
+++ Zope3/src/zope/app/onlinehelp/tests/test_onlinehelp.py	Sat Aug  2 07:19:25 2003
@@ -49,9 +49,6 @@
         self.assertEqual(self.topic['help2'].title, 'Help 2')
         self.assertEqual(self.topic._registry[(I1, 'view.html')][0].title,
                          'Help 2')
-        self.topic.unregisterHelpTopic('help2')
-        self.assertEqual(self.topic.get('help2', None), None)
-        self.assertEqual(self.topic._registry[(I1, 'view.html')], [])
         
     def test_getTopicsForInterfaceAndView(self):
         path = os.path.join(testdir(), 'help2.txt')