Skip to content

Commit

Permalink
Add a unit test for locale.list
Browse files Browse the repository at this point in the history
  • Loading branch information
leekchan committed Sep 23, 2014
1 parent cf67a17 commit ebbf2e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tornado/test/locale_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,10 @@ def test_format_date(self):
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')

0 comments on commit ebbf2e3

Please sign in to comment.