summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Morega <alex@grep.ro>2013-07-06 10:44:27 +0200
committerAlex Morega <alex@grep.ro>2013-07-06 14:54:57 +0200
commitce08a2d18a8ae63c1d379be6023ebdc6b0c5a3a8 (patch)
tree9e7b083a32efb6fc96b3476f0fb8273296de3236 /tests
parent356229b9b9b171895b463617c3af906de1c9884e (diff)
downloadbabel-ce08a2d18a8ae63c1d379be6023ebdc6b0c5a3a8.tar.gz
copy babel.localedata doctests as unit tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_localedata.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_localedata.py b/tests/test_localedata.py
index b029c60..565d6ab 100644
--- a/tests/test_localedata.py
+++ b/tests/test_localedata.py
@@ -63,9 +63,19 @@ class MergeResolveTestCase(unittest.TestCase):
}, dict(d.items()))
+def test_load():
+ assert localedata.load('en_US')['languages']['sv'] == 'Swedish'
+ assert localedata.load('en_US') is localedata.load('en_US')
+
+
+def test_merge():
+ d = {1: 'foo', 3: 'baz'}
+ localedata.merge(d, {1: 'Foo', 2: 'Bar'})
+ assert d == {1: 'Foo', 2: 'Bar', 3: 'baz'}
+
+
def suite():
suite = unittest.TestSuite()
- suite.addTest(doctest.DocTestSuite(localedata))
suite.addTest(unittest.makeSuite(MergeResolveTestCase))
return suite