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)
def test_lower(self): wl = WordList(['Zen', 'oF', 'PYTHON']) assert_equal(wl.lower(), WordList(['zen', 'of', 'python']))
def test_pluralize(self): wl = WordList(['dog', 'cat', 'buffalo']) assert_equal(wl.pluralize(), ['dogs', 'cats', 'buffaloes'])
def test_upper(self): wl = WordList(self.words) assert_equal(wl.upper(), WordList([w.upper() for w in self.words]))
def test_singularize(self): wl = WordList(['dogs', 'cats', 'buffaloes', 'men', 'mice']) assert_equal(wl.singularize(), ['dog', 'cat', 'buffalo', 'man', 'mouse' ])