[Zope-Checkins] CVS: Zope3/lib/python/Zope/I18n/tests - testNegotiator.py:1.1.2.4
Guido van Rossum
guido@python.org
Tue, 4 Jun 2002 14:59:58 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/I18n/tests
In directory cvs.zope.org:/tmp/cvs-serv1575/lib/python/Zope/I18n/tests
Modified Files:
Tag: Zope-3x-branch
testNegotiator.py
Log Message:
Whoever (not Jeremy :-) checks in files from Windows with the CRLF
markers still left in, please stop doing this. It screws up the
checkouts for everyone else (including Windows users who use the
command line cvs tools). Hint: some wincvs do this.
=== Zope3/lib/python/Zope/I18n/tests/testNegotiator.py 1.1.2.3 => 1.1.2.4 ===
#
##############################################################################
-import unittest, sys
-
-from Zope.I18n.Negotiator import Negotiator
-from Zope.I18n.IUserPreferedLanguages import IUserPreferedLanguages
-from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
-
-class Env:
-
- __implements__ = IUserPreferedLanguages
-
- def __init__(self, langs=()):
- self.langs = langs
-
- def getLanguages(self):
- return self.langs
-
-
-class Test(PlacelessSetup, unittest.TestCase):
-
- def setUp(self):
- PlacelessSetup.setUp(self)
- self.Negotiator= Negotiator()
-
- def test1(self):
-
- _cases = (
- ( ('en','de'), ('en','de','fr'), 'en'),
- ( ('en'), ('it','de','fr'), None)
- )
-
- for user_pref_langs, obj_langs, expected in _cases:
-
- env = Env(user_pref_langs)
-
- self.assertEqual( self.Negotiator.getLanguage( obj_langs, env),
- expected)
-
-
-
-
-def test_suite():
- loader=unittest.TestLoader()
- return loader.loadTestsFromTestCase(Test)
-
-if __name__=='__main__':
- unittest.TextTestRunner().run(test_suite())
+import unittest, sys
+
+from Zope.I18n.Negotiator import Negotiator
+from Zope.I18n.IUserPreferedLanguages import IUserPreferedLanguages
+from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
+
+class Env:
+
+ __implements__ = IUserPreferedLanguages
+
+ def __init__(self, langs=()):
+ self.langs = langs
+
+ def getLanguages(self):
+ return self.langs
+
+
+class Test(PlacelessSetup, unittest.TestCase):
+
+ def setUp(self):
+ PlacelessSetup.setUp(self)
+ self.Negotiator= Negotiator()
+
+ def test1(self):
+
+ _cases = (
+ ( ('en','de'), ('en','de','fr'), 'en'),
+ ( ('en'), ('it','de','fr'), None)
+ )
+
+ for user_pref_langs, obj_langs, expected in _cases:
+
+ env = Env(user_pref_langs)
+
+ self.assertEqual( self.Negotiator.getLanguage( obj_langs, env),
+ expected)
+
+
+
+
+def test_suite():
+ loader=unittest.TestLoader()
+ return loader.loadTestsFromTestCase(Test)
+
+if __name__=='__main__':
+ unittest.TextTestRunner().run(test_suite())