]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add a unit test for locale.list
authorLee Kyoung chan <leekchan@gmail.com>
Tue, 23 Sep 2014 11:44:49 +0000 (20:44 +0900)
committerLee Kyoung chan <leekchan@gmail.com>
Tue, 23 Sep 2014 11:44:49 +0000 (20:44 +0900)
tornado/test/locale_test.py

index 30668114889bccc3f3d477816e693c5640a54fef..144d766186c037713ed64d49753dfc1bc9b6645a 100644 (file)
@@ -84,3 +84,10 @@ class EnglishTest(unittest.TestCase):
     def test_friendly_number(self):
         locale = tornado.locale.get('en_US')
         self.assertEqual(locale.friendly_number(1000000), '1,000,000')
+
+    def test_list(self):
+        locale = tornado.locale.get('en_US')
+        self.assertEqual(locale.list([]), '')
+        self.assertEqual(locale.list(['A']), 'A')
+        self.assertEqual(locale.list(['A', 'B']), 'A and B')
+        self.assertEqual(locale.list(['A', 'B', 'C']), 'A, B and C')