def test_sis(self): 'words ending in SIS' nouns = { 'thesis': 'theses' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_eau(self): 'words ending in EAU' nouns = { 'tableau': 'tableaux' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_oot(self): 'special case: foot' nouns = { 'foot': 'feet' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_child(self): 'special case: child' nouns = { 'child': 'children' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_f_ves(self): 'words ending in F that become VES' nouns = { 'leaf': 'leaves', 'loaf': 'loaves' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_ooth(self): 'words ending in OOTH' nouns = { 'booth': 'booths', 'tooth': 'teeth' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_ouce(self): 'words ending in OUSE' nouns = { 'mouse': 'mice', 'louse': 'lice' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_default(self): 'parole comuni' nouns = { 'papaya': 'papayas', 'whip': 'whips', 'palimpsest': 'palimpsests' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_default(self): 'unexceptional words' nouns = { 'papaya': 'papayas', 'whip': 'whips', 'palimpsest': 'palimpsests' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_ife(self): 'words ending in IFE' nouns = { 'knife': 'knives', 'wife': 'wives', 'lowlife': 'lowlifes' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_y(self): 'words ending in Y' nouns = { 'utility': 'utilities', 'vacancy': 'vacancies', 'boy': 'boys', 'day': 'days' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_elf(self): 'words ending in ELF' nouns = { 'elf': 'elves', 'shelf': 'shelves', 'delf': 'delfs', 'pelf': 'pelfs' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_man(self): 'words ending in MAN' nouns = { 'man': 'men', 'mailman': 'mailmen', 'human': 'humans', 'roman': 'romans' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_man(self): 'parole che finiscono con MAN' nouns = { 'man': 'men', 'mailman': 'mailmen', 'human': 'humans', 'roman': 'romans' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_y(self): 'parole che finiscono con Y' nouns = { 'utility': 'utilities', 'vacancy': 'vacancies', 'boy': 'boys', 'day': 'days' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_elf(self): 'parole che finiscono con ELF' nouns = { 'elf': 'elves', 'shelf': 'shelves', 'delf': 'delfs', 'pelf': 'pelfs' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_h(self): 'words ending in H' nouns = { 'coach': 'coaches', 'glitch': 'glitches', 'rash': 'rashes', 'watch': 'watches', 'cheetah': 'cheetahs', 'cough': 'coughs' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_same(self): 'parole che sono il loro stesso plurale' nouns = { 'sheep': 'sheep', 'deer': 'deer', 'fish': 'fish', 'moose': 'moose', 'aircraft': 'aircraft', 'series': 'series', 'haiku': 'haiku' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_same(self): 'words that are their own plural' nouns = { 'sheep': 'sheep', 'deer': 'deer', 'fish': 'fish', 'moose': 'moose', 'aircraft': 'aircraft', 'series': 'series', 'haiku': 'haiku' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_sxz(self): 'words ending in S, X, and Z' nouns = { 'bass': 'basses', 'bus': 'buses', 'walrus': 'walruses', 'box': 'boxes', 'fax': 'faxes', 'suffix': 'suffixes', 'mailbox': 'mailboxes', 'buzz': 'buzzes', 'waltz': 'waltzes' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_sxz(self): 'parole che finiscono con S, X, o Z' nouns = { 'bass': 'basses', 'bus': 'buses', 'walrus': 'walruses', 'box': 'boxes', 'fax': 'faxes', 'suffix': 'suffixes', 'mailbox': 'mailboxes', 'buzz': 'buzzes', 'waltz': 'waltzes' } for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_oot(self): 'caso particolare: foot' nouns = {'foot': 'feet'} for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_ooth(self): 'parole che finiscono con OOTH' nouns = {'booth': 'booths', 'tooth': 'teeth'} for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_plural(self): self.assertEqual(plural('box'),'boxes') self.assertEqual(plural('couch'),'couches') self.assertEqual(plural('ivy'),'ivies') self.assertEqual(plural('light'),'lights')
'computer': 'computers', 'rock': 'rocks', 'paper': 'papers', 'mouse': 'mice', 'louse': 'lice', 'child': 'children', 'foot': 'feet', 'booth': 'booths', 'tooth': 'teeth', 'leaf': 'leaves', 'loaf': 'loaves', 'thesis': 'theses', 'man': 'men', 'mailman': 'mailmen', 'knife': 'knives', 'wife': 'wives', 'tableau': 'tableaux', 'elf': 'elves', 'shelf': 'shelves', } for noun, correctPlural in KnownValues.nouns.items(): testMethod = lambda self: KnownValues.failUnlessEqual(self, plural(noun), correctPlural) testMethod.__doc__ = "%s --> %s" % (noun, correctPlural) instanceMethod = new.instancemethod(testMethod, None, KnownValues) setattr(KnownValues, "test_%s" % noun, instanceMethod) if __name__ == "__main__": unittest.main()
'rock': 'rocks', 'paper': 'papers', 'mouse': 'mice', 'louse': 'lice', 'child': 'children', 'foot': 'feet', 'booth': 'booths', 'tooth': 'teeth', 'leaf': 'leaves', 'loaf': 'loaves', 'thesis': 'theses', 'man': 'men', 'mailman': 'mailmen', 'knife': 'knives', 'wife': 'wives', 'tableau': 'tableaux', 'elf': 'elves', 'shelf': 'shelves', } for noun, correctPlural in KnownValues.nouns.items(): testMethod = lambda self: KnownValues.failUnlessEqual( self, plural(noun), correctPlural) testMethod.__doc__ = "%s --> %s" % (noun, correctPlural) instanceMethod = new.instancemethod(testMethod, None, KnownValues) setattr(KnownValues, "test_%s" % noun, instanceMethod) if __name__ == "__main__": unittest.main()
def test_ouce(self): 'parole che finiscono con OUSE' nouns = {'mouse': 'mice', 'louse': 'lice'} for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_sis(self): 'parole che finiscono con SIS' nouns = {'thesis': 'theses'} for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_f_ves(self): 'parole che finiscono con una F che diventa VES' nouns = {'leaf': 'leaves', 'loaf': 'loaves'} for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_eau(self): 'parole che finiscono con EAU' nouns = {'tableau': 'tableaux'} for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)
def test_ife(self): 'parole che finiscono con IFE' nouns = {'knife': 'knives', 'wife': 'wives', 'lowlife': 'lowlifes'} for singular, plural in nouns.items(): self.assertEqual(plural6.plural(singular), plural)