Mercurial > babel > old > babel-test
diff babel/messages/tests/catalog.py @ 278:709410bfd67c stable-0.9.x
Ported [305] to 0.9.x branch.
author | cmlenz |
---|---|
date | Tue, 04 Sep 2007 15:12:23 +0000 |
parents | 2097287603e7 |
children | 61e6b1933af4 274506f102ed |
line wrap: on
line diff
--- a/babel/messages/tests/catalog.py +++ b/babel/messages/tests/catalog.py @@ -73,6 +73,24 @@ cat.add('foo', locations=[('foo.py', 1)]) self.assertEqual([('foo.py', 1)], cat['foo'].locations) + def test_update_message_changed_to_plural(self): + cat = catalog.Catalog() + cat.add(u'foo', u'Voh') + tmpl = catalog.Catalog() + tmpl.add((u'foo', u'foos')) + cat.update(tmpl) + self.assertEqual((u'Voh', ''), cat['foo'].string) + assert cat['foo'].fuzzy + + def test_update_message_changed_to_simple(self): + cat = catalog.Catalog() + cat.add((u'foo' u'foos'), (u'Voh', u'Vöhs')) + tmpl = catalog.Catalog() + tmpl.add(u'foo') + cat.update(tmpl) + self.assertEqual(u'Voh', cat['foo'].string) + assert cat['foo'].fuzzy + def test_update_message_updates_comments(self): cat = catalog.Catalog() cat[u'foo'] = catalog.Message('foo', locations=[('main.py', 5)])