[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/ Fix test by moving it to the correct location (after ZCML stuff had been

Philipp von Weitershausen philikon at philikon.de
Sun Apr 9 10:45:44 EDT 2006


Log message for revision 66727:
  Fix test by moving it to the correct location (after ZCML stuff had been
  moved to zope.i18n).
  

Changed:
  D   Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py
  A   Zope3/branches/jim-adapter/src/zope/i18n/tests/test_zcml.py

-=-
Deleted: Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py	2006-04-09 14:42:12 UTC (rev 66726)
+++ Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py	2006-04-09 14:45:44 UTC (rev 66727)
@@ -1,62 +0,0 @@
-##############################################################################
-#
-# 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.1 (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 gts ZCML namespace directives.
-
-$Id$
-"""
-import os
-import unittest
-
-from zope.component.testing import PlacelessSetup
-from zope.configuration import xmlconfig
-
-from zope.app import zapi
-from zope.i18n.interfaces import ITranslationDomain
-import zope.app.i18n
-import zope.i18n.tests
-
-template = """<configure
-   xmlns='http://namespaces.zope.org/zope'
-   xmlns:i18n='http://namespaces.zope.org/i18n'>
-   %s
-   </configure>"""
-
-
-class DirectivesTest(PlacelessSetup, unittest.TestCase):
-
-    def setUp(self):
-        super(DirectivesTest, self).setUp()
-        self.context = xmlconfig.file('meta.zcml', zope.app.i18n)
-
-    def testRegisterTranslations(self):
-        eq = self.assertEqual
-        eq(zapi.queryUtility(ITranslationDomain), None)
-        xmlconfig.string(
-            template % '''
-            <configure package="zope.i18n.tests">
-            <i18n:registerTranslations directory="./locale" />
-            </configure>
-            ''', self.context)
-        path = os.path.join(os.path.dirname(zope.i18n.tests.__file__),
-                            'locale', 'en',
-                            'LC_MESSAGES', 'zope-i18n.mo')
-        util = zapi.getUtility(ITranslationDomain, 'zope-i18n')
-        eq(util._catalogs, {'test': ['test'], 'en': [unicode(path)]})
-
-
-def test_suite():
-    return unittest.makeSuite(DirectivesTest)
-
-if __name__ == '__main__':
-    unittest.TextTestRunner().run(test_suite())

Copied: Zope3/branches/jim-adapter/src/zope/i18n/tests/test_zcml.py (from rev 66723, Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py)
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/i18n/tests/testi18ndirectives.py	2006-04-09 13:48:55 UTC (rev 66723)
+++ Zope3/branches/jim-adapter/src/zope/i18n/tests/test_zcml.py	2006-04-09 14:45:44 UTC (rev 66727)
@@ -0,0 +1,58 @@
+##############################################################################
+#
+# 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.1 (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 gts ZCML namespace directives.
+
+$Id$
+"""
+import os
+import unittest
+
+import zope.component
+import zope.i18n.tests
+from zope.component.testing import PlacelessSetup
+from zope.configuration import xmlconfig
+from zope.i18n.interfaces import ITranslationDomain
+
+template = """\
+<configure
+    xmlns='http://namespaces.zope.org/zope'
+    xmlns:i18n='http://namespaces.zope.org/i18n'>
+  %s
+</configure>"""
+
+class DirectivesTest(PlacelessSetup, unittest.TestCase):
+
+    def setUp(self):
+        super(DirectivesTest, self).setUp()
+        self.context = xmlconfig.file('meta.zcml', zope.i18n)
+
+    def testRegisterTranslations(self):
+        self.assert_(zope.component.queryUtility(ITranslationDomain) is None)
+        xmlconfig.string(
+            template % '''
+            <configure package="zope.i18n.tests">
+            <i18n:registerTranslations directory="locale" />
+            </configure>
+            ''', self.context)
+        path = os.path.join(os.path.dirname(zope.i18n.tests.__file__),
+                            'locale', 'en', 'LC_MESSAGES', 'zope-i18n.mo')
+        util = zope.component.getUtility(ITranslationDomain, 'zope-i18n')
+        self.assertEquals(util._catalogs,
+                          {'test': ['test'], 'en': [unicode(path)]})
+
+def test_suite():
+    return unittest.makeSuite(DirectivesTest)
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')



More information about the Zope3-Checkins mailing list