[Zope3-checkins] CVS: Zope3/src/zope/i18n/tests - test_formats.py:1.4 test_locales.py:1.2 test_xmllocales.py:1.4
Stephan Richter
srichter@cbu.edu
Thu, 9 Jan 2003 14:20:57 -0500
Update of /cvs-repository/Zope3/src/zope/i18n/tests
In directory cvs.zope.org:/tmp/cvs-serv850/i18n/tests
Modified Files:
test_formats.py test_locales.py test_xmllocales.py
Log Message:
Removed requirement for os.chdir()
Removed DOCTYPE definition from XML Locale Files. Provide a script to do
that automatically for all files.
Deactivate parsing all XML Files tests, since they took a long time.
=== Zope3/src/zope/i18n/tests/test_formats.py 1.3 => 1.4 ===
--- Zope3/src/zope/i18n/tests/test_formats.py:1.3 Thu Jan 9 09:33:30 2003
+++ Zope3/src/zope/i18n/tests/test_formats.py Thu Jan 9 14:20:23 2003
@@ -131,11 +131,8 @@
"""
def setUp(self):
- org = os.curdir
- os.chdir(os.path.join(testdir(), 'xmllocales'))
path = os.path.join(testdir(), 'xmllocales', 'de.xml')
self.locale = ICUXMLLocaleFactory(path)()
- os.chdir(org)
self.info = buildDateTimeParseInfo(self.locale.getDefaultCalendar())
def testEra(self):
@@ -167,11 +164,8 @@
interface."""
def setUp(self):
- org = os.curdir
- os.chdir(os.path.join(testdir(), 'xmllocales'))
path = os.path.join(testdir(), 'xmllocales', 'de.xml')
locale = ICUXMLLocaleFactory(path)()
- os.chdir(org)
self.format = DateTimeFormat(calendar=locale.getDefaultCalendar())
def testInterfaceConformity(self):
@@ -465,11 +459,8 @@
"""Test the functionality of an implmentation of the NumberFormat."""
def setUp(self):
- org = os.curdir
- os.chdir(os.path.join(testdir(), 'xmllocales'))
path = os.path.join(testdir(), 'xmllocales', 'de_DE.xml')
locale = ICUXMLLocaleFactory(path)()
- os.chdir(org)
self.format = NumberFormat(
symbols=locale.getDefaultNumberFormat().getSymbolMap())
=== Zope3/src/zope/i18n/tests/test_locales.py 1.1 => 1.2 ===
--- Zope3/src/zope/i18n/tests/test_locales.py:1.1 Sun Jan 5 15:20:21 2003
+++ Zope3/src/zope/i18n/tests/test_locales.py Thu Jan 9 14:20:23 2003
@@ -386,8 +386,6 @@
class TestICUXMLLocaleFactory(TestCase):
def setUp(self):
- org = os.curdir
- os.chdir(os.path.join(testdir(), 'xmllocales'))
self.factory0 = ICUXMLLocaleFactory(
os.path.join(testdir(), 'xmllocales', 'root.xml'))
self.factory = ICUXMLLocaleFactory(
@@ -396,7 +394,6 @@
os.path.join(testdir(), 'xmllocales', 'de_DE.xml'))
self.factory3 = ICUXMLLocaleFactory(
os.path.join(testdir(), 'xmllocales', 'de_DE_PREEURO.xml'))
- os.chdir(org)
def test_GermanySpecificGermanLocale(self):
# Well, if the factory can create the Locale we are in good
@@ -503,11 +500,8 @@
class TestICULocale(TestILocale):
def _newLocale(self):
- org = os.curdir
- os.chdir(os.path.join(testdir(), 'xmllocales'))
path = os.path.join(testdir(), 'xmllocales', 'root.xml')
localeFactory = ICUXMLLocaleFactory(path)
- os.chdir(org)
return localeFactory()
def testId(self):
=== Zope3/src/zope/i18n/tests/test_xmllocales.py 1.3 => 1.4 ===
--- Zope3/src/zope/i18n/tests/test_xmllocales.py:1.3 Mon Jan 6 07:51:07 2003
+++ Zope3/src/zope/i18n/tests/test_xmllocales.py Thu Jan 9 14:20:23 2003
@@ -57,12 +57,15 @@
suite = TestSuite()
from zope import i18n
locale_dir = os.path.join(os.path.dirname(i18n.__file__), 'locales')
- org = os.curdir
- os.chdir(locale_dir)
for file in filter(lambda f: f.endswith('.xml'),
os.listdir(locale_dir))[:]:
path = os.path.join(locale_dir, file)
case = LocaleXMLFileTestCase(path)
suite.addTest(case)
- os.chdir(org)
return suite
+
+# Note: These tests are disabled, just because they take a long time to run.
+# You should run these tests if you update the aprsing code and/or
+# update the Locale XML Files.
+def test_suite():
+ return TestSuite()