[Zope3-checkins] CVS: Zope3/lib/python/Zope/TextIndex/tests - testLexicon.py:1.2

Guido van Rossum guido@python.org
Tue, 3 Dec 2002 14:15:24 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/TextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv30828

Modified Files:
	testLexicon.py 
Log Message:
Skip testSplitterLocaleAwareness() when the German locale doesn't
work.  This should avoid test breakage on some platforms besides Mac
OSX.


=== Zope3/lib/python/Zope/TextIndex/tests/testLexicon.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/TextIndex/tests/testLexicon.py:1.1	Tue Dec  3 09:28:16 2002
+++ Zope3/lib/python/Zope/TextIndex/tests/testLexicon.py	Tue Dec  3 14:15:22 2002
@@ -115,16 +115,17 @@
         self.assertEqual(wids, [2])
         
     def testSplitterLocaleAwareness(self):
-        if sys.platform == 'darwin':
-            return # This test doesn't work on Mac OSX :-(
         from Zope.TextIndex.HTMLSplitter import HTMLWordSplitter
         import locale
         loc = locale.setlocale(locale.LC_ALL) # get current locale
          # set German locale
-        if sys.platform != 'win32':
-            locale.setlocale(locale.LC_ALL, 'de_DE.ISO8859-1')
-        else:
-            locale.setlocale(locale.LC_ALL, 'German_Germany.1252')
+        try:
+            if sys.platform != 'win32':
+                locale.setlocale(locale.LC_ALL, 'de_DE.ISO8859-1')
+            else:
+                locale.setlocale(locale.LC_ALL, 'German_Germany.1252')
+        except locale.Error:
+            return # This test doesn't work here :-(
         words = ['mülltonne waschbär behörde überflieger']
         words = Splitter().process(words)
         self.assertEqual(