[Zope3-dev] testSplitterLocaleAwareness bombing out
Casey Duncan
casey@zope.com
Tue, 3 Dec 2002 11:38:44 -0500
Yes, but in order to write meaningful tests, you must be able to make=20
reasonable assumptions about the environment. Most stock Unices in wide u=
se=20
that I know of would support this locale (however, Windows would not, it =
uses=20
completely different naming conventions for locales).
Perhaps the test should be conditionally defined only if a suitable local=
e=20
exists on the system. Otherwise the test is skipped. I dunno what others=20
think of that approach, I think it is pragmatic, if less then ideal.
The alternative is to just let the test fail on systems that don't suppor=
t any=20
locales that the test can use. This is also less than ideal, but certainl=
y=20
gives more disclosure.
-Casey
On Tuesday 03 December 2002 10:09 am, Albertas Agejevas wrote:
> Hi, sprinters,
>=20
> ERROR: testSplitterLocaleAwareness (Zope.TextIndex.tests.testLexicon.Te=
st)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File=20
"/home/users/alga/Zope3/lib/python/Zope/TextIndex/tests/testLexicon.py", =
line=20
125, in testSplitterLocaleAwareness
> locale.setlocale(locale.LC_ALL, 'de_DE.ISO8859-1')
> File "/usr/lib/python2.2/locale.py", line 372, in setlocale
> return _setlocale(category, locale)
> Error: locale setting not supported
>=20
> As a matter of fact, you cannot rely on any of the locales except
> "POSIX" and "C" to be available. On Debian systems the administrator
> chooses what locales she wants compiled on her machine, and not
> surprisingly de_DE.ISO8859-1 is not compiled anywhere in our office.
>=20
> Also, it would be nice to see docstrings and CVS $Id$ tags in all the
> files.
>=20
> Albertas
>=20