[Zope3-checkins] CVS: Zope3/src/zope/tal/tests - test_files.py:1.3
test_talinterpreter.py:1.9
Stephan Richter
srichter at cosmos.phy.tufts.edu
Mon Mar 8 18:34:29 EST 2004
Update of /cvs-repository/Zope3/src/zope/tal/tests
In directory cvs.zope.org:/tmp/cvs-serv4394/src/zope/tal/tests
Modified Files:
test_files.py test_talinterpreter.py
Log Message:
Use new translation API.
=== Zope3/src/zope/tal/tests/test_files.py 1.2 => 1.3 ===
--- Zope3/src/zope/tal/tests/test_files.py:1.2 Wed Dec 25 09:15:31 2002
+++ Zope3/src/zope/tal/tests/test_files.py Mon Mar 8 18:33:58 2004
@@ -12,7 +12,10 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Tests that run driver.py over input files comparing to output files."""
+"""Tests that run driver.py over input files comparing to output files.
+
+$Id$
+"""
import glob
import os
=== Zope3/src/zope/tal/tests/test_talinterpreter.py 1.8 => 1.9 ===
--- Zope3/src/zope/tal/tests/test_talinterpreter.py:1.8 Thu Aug 21 10:19:29 2003
+++ Zope3/src/zope/tal/tests/test_talinterpreter.py Mon Mar 8 18:33:58 2004
@@ -24,7 +24,7 @@
from zope.tal.taldefs import METALError, I18NError
from zope.tal.htmltalparser import HTMLTALParser
from zope.tal.talinterpreter import TALInterpreter
-from zope.tal.dummyengine import DummyEngine, DummyTranslationService
+from zope.tal.dummyengine import DummyEngine, DummyTranslationDomain
from zope.tal.tests import utils
from zope.i18n.messageid import MessageID
@@ -175,18 +175,18 @@
def test_for_correct_msgids(self):
- class CollectingTranslationService(DummyTranslationService):
+ class CollectingTranslationDomain(DummyTranslationDomain):
data = []
- def translate(self, msgid, domain=None, mapping=None,
+ def translate(self, msgid, mapping=None,
context=None, target_language=None, default=None):
self.data.append(msgid)
- return DummyTranslationService.translate(
+ return DummyTranslationDomain.translate(
self,
- msgid, domain, mapping, context, target_language, default)
+ msgid, mapping, context, target_language, default)
- xlatsvc = CollectingTranslationService()
- self.engine.translationService = xlatsvc
+ xlatdmn = CollectingTranslationDomain()
+ self.engine.translationDomain = xlatdmn
result = StringIO()
program, macros = self._compile(
'<div i18n:translate="">This is text for '
@@ -195,9 +195,9 @@
self.interpreter = TALInterpreter(program, {}, self.engine,
stream=result)
self.interpreter()
- self.assert_('BaRvAlUe' in xlatsvc.data)
+ self.assert_('BaRvAlUe' in xlatdmn.data)
self.assert_('This is text for ${bar_name}.' in
- xlatsvc.data)
+ xlatdmn.data)
self.assertEqual(
'<div>THIS IS TEXT FOR <span>BARVALUE</span>.</div>\n',
result.getvalue())
More information about the Zope3-Checkins
mailing list