| 1234567891011121314151617181920212223242526272829 |
- from unittest import TestCase
- from singplur import singularize, pluralize
- class SingplurTest(TestCase):
- pairs = (
- ('branch', 'branches'),
- ('payment', 'payments'),
- ('order', 'orders'),
- ('party', 'parties'),
- ('knife', 'knives'),
- ('roof', 'roofs'),
- ('leaf', 'leaves'),
- ('box', 'boxes'),
- ('sheep', 'sheep'),
- ('salmon', 'salmon'),
- ('person', 'people'),
- ('shoe', 'shoes'),
- ('foot', 'feet'),
- ('dice', 'dices'),
- )
- def test_singularize(self):
- for singular, plural in self.pairs:
- self.assertEqual(singularize(plural), singular)
- def test_pluralize(self):
- for singular, plural in self.pairs:
- self.assertEqual(pluralize(singular), plural)
|