Example #1
0
 def test_default(self):
     'unexceptional words'
     nouns = {
         'papaya': 'papayas',
         'whip': 'whips',
         'palimpsest': 'palimpsests'
         }
     for singular, plural in nouns.items():
         self.assertEqual(plural1.plural(singular), plural)
Example #2
0
 def test_default(self):
     'parole comuni'
     nouns = {
         'papaya': 'papayas',
         'whip': 'whips',
         'palimpsest': 'palimpsests'
     }
     for singular, plural in nouns.items():
         self.assertEqual(plural1.plural(singular), plural)
 def test_default(self):
     'unexceptional words'
     nouns = {
         'papaya': 'papayas',
         'whip': 'whips',
         'palimpsest': 'palimpsests'
     }
     for singular, plural in nouns.items():
         self.assertEqual(plural1.plural(singular), plural)
Example #4
0
 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(plural1.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(plural1.plural(singular), plural)
Example #6
0
 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(plural1.plural(singular), plural)
Example #7
0
 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(plural1.plural(singular), plural)
Example #8
0
 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(plural1.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(plural1.plural(singular), plural)
Example #10
0
 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(plural1.plural(singular), plural)
Example #11
0
 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(plural1.plural(singular), plural)
Example #12
0
 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(plural1.plural(singular), plural)
Example #13
0
 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(plural1.plural(singular), plural)
Example #14
0
 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(plural1.plural(singular), plural)
Example #15
0
             'box': 'boxes',
             'fax': 'faxes',
             'suffix': 'suffixes',
             'mailbox': 'mailboxes',
             'buzz': 'buzzes',
             'waltz': 'waltzes',
             'coach': 'coaches',
             'glitch': 'glitches',
             'rash': 'rashes',
             'watch': 'watches',
             'cheetah': 'cheetahs',
             'cough': 'coughs',
             'utility': 'utilities',
             'vacancy': 'vacancies',
             'boy': 'boys',
             'day': 'days',
             'computer': 'computers',
             'rock': 'rocks',
             'paper': 'papers',
             }

for noun, pluralnoun in KnownValues.nouns.items():
    func = lambda self, noun=noun, pluralnoun=pluralnoun: \
           KnownValues.failUnlessEqual(self, plural(noun), pluralnoun)
    func.__doc__ = "%s --> %s" % (noun, pluralnoun)
    instanceMethod = new.instancemethod(func, None, KnownValues)
    setattr(KnownValues, "test_%s" % noun, instanceMethod)

if __name__ == "__main__":
    unittest.main()
Example #16
0
 def test_default(self):
     "unexceptional words"
     nouns = {"papaya": "papayas", "whip": "whips", "palimpsest": "palimpsests"}
     for singular, plural in nouns.items():
         self.assertEqual(plural1.plural(singular), plural)
Example #17
0
 def test_es1(self):
     self.assertEqual(plural1.plural('box'), 'boxes')
Example #18
0
 def test_s(self):
     self.assertEqual(plural1.plural('car'), 'cars')
Example #19
0
 def test_ies(self):
     self.assertEqual(plural1.plural('vacancy'), 'vacancies')
Example #20
0
 def test_es2(self):
     self.assertEqual(plural1.plural('rash'), 'rashes')
Example #21
0
        'fax': 'faxes',
        'suffix': 'suffixes',
        'mailbox': 'mailboxes',
        'buzz': 'buzzes',
        'waltz': 'waltzes',
        'coach': 'coaches',
        'glitch': 'glitches',
        'rash': 'rashes',
        'watch': 'watches',
        'cheetah': 'cheetahs',
        'cough': 'coughs',
        'utility': 'utilities',
        'vacancy': 'vacancies',
        'boy': 'boys',
        'day': 'days',
        'computer': 'computers',
        'rock': 'rocks',
        'paper': 'papers',
    }


for noun, pluralnoun in list(KnownValues.nouns.items()):
    func = lambda self, noun=noun, pluralnoun=pluralnoun: \
           KnownValues.failUnlessEqual(self, plural(noun), pluralnoun)
    func.__doc__ = "%s --> %s" % (noun, pluralnoun)
    instanceMethod = new.instancemethod(func, None, KnownValues)
    setattr(KnownValues, "test_%s" % noun, instanceMethod)

if __name__ == "__main__":
    unittest.main()