[Zope3-checkins] CVS: Zope3/src/zope/app/i18n/tests - testi18ndirectives.py:1.4
Jim Fulton
jim@zope.com
Mon, 28 Jul 2003 18:20:59 -0400
Update of /cvs-repository/Zope3/src/zope/app/i18n/tests
In directory cvs.zope.org:/tmp/cvs-serv29869/src/zope/app/i18n/tests
Modified Files:
testi18ndirectives.py
Log Message:
Changed to use new configuration api
=== Zope3/src/zope/app/i18n/tests/testi18ndirectives.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/i18n/tests/testi18ndirectives.py:1.3 Thu May 1 15:35:18 2003
+++ Zope3/src/zope/app/i18n/tests/testi18ndirectives.py Mon Jul 28 18:20:25 2003
@@ -21,7 +21,7 @@
from cStringIO import StringIO
from zope.component.tests.placelesssetup import PlacelessSetup
-from zope.configuration.xmlconfig import xmlconfig, Context, XMLConfig
+from zope.configuration import xmlconfig
import zope.app.i18n
import zope.i18n.tests
@@ -43,17 +43,18 @@
def setUp(self):
PlacelessSetup.setUp(self)
- XMLConfig('meta.zcml', zope.app.i18n)()
+ self.context = xmlconfig.file('meta.zcml', zope.app.i18n)
def testRegisterTranslations(self):
eq = self.assertEqual
eq(translationService._catalogs, {})
- xmlconfig(StringIO(template % (
- '''
+ xmlconfig.string(
+ template % '''
+ <configure package="zope.i18n.tests">
<gts:registerTranslations directory="./locale" />
- '''
- )), None, Context([], zope.i18n.tests))
- path = os.path.join(Context([], zope.i18n.tests).path(),
+ </configure>
+ ''', self.context)
+ path = os.path.join(os.path.dirname(zope.i18n.tests.__file__),
'locale', 'en',
'LC_MESSAGES', 'zope-i18n.mo')
eq(translationService._catalogs,
@@ -62,11 +63,10 @@
def testDefaultLanguages(self):
eq = self.assertEqual
eq(translationService._fallbacks, ['en'])
- xmlconfig(StringIO(template % (
- '''
+ xmlconfig.string(
+ template % '''
<gts:defaultLanguages languages="de nl xx" />
- '''
- )), None, Context([], zope.i18n.tests))
+ ''', self.context)
eq(translationService._fallbacks, ['de', 'nl', 'xx'])