Exemple #1
0
 def test_count(self):
     wl = WordList(['monty', 'python', 'Python', 'Monty'])
     assert_equal(wl.count('monty'), 2)
     assert_equal(wl.count('monty', case_sensitive=True), 1)
     assert_equal(wl.count('mon'), 0)
Exemple #2
0
 def test_lower(self):
     wl = WordList(['Zen', 'oF', 'PYTHON'])
     assert_equal(wl.lower(), WordList(['zen', 'of', 'python']))
Exemple #3
0
 def test_pluralize(self):
     wl = WordList(['dog', 'cat', 'buffalo'])
     assert_equal(wl.pluralize(), ['dogs', 'cats', 'buffaloes'])
Exemple #4
0
 def test_upper(self):
     wl = WordList(self.words)
     assert_equal(wl.upper(), WordList([w.upper() for w in self.words]))
Exemple #5
0
 def test_singularize(self):
     wl = WordList(['dogs', 'cats', 'buffaloes', 'men', 'mice'])
     assert_equal(wl.singularize(), ['dog', 'cat', 'buffalo', 'man', 'mouse'
                  ])