improve tests and test coverage

This commit is contained in:
mutantmonkey
2013-08-25 14:32:42 -07:00
parent f5fb2fc37d
commit 23d99dd326
6 changed files with 55 additions and 20 deletions

View File

@@ -14,12 +14,17 @@ class TestSlogan(unittest.TestCase):
def test_sloganize(self):
out = sloganize('slogan')
assert len(out) > 0
self.assertRegex(out, ".*slogan.*")
def test_slogan(self):
input = Mock(group=lambda x: 'slogan')
slogan(self.phenny, input)
out = self.phenny.say.call_args[0][0]
self.assertNotEqual(out, "Looks like an issue with sloganizer.net")
out = self.phenny.say.call_args[0][0]
self.assertRegex(out, ".*slogan.*")
def test_slogan_none(self):
input = Mock(group=lambda x: None)
slogan(self.phenny, input)
self.phenny.say.assert_called_once_with(
"You need to specify a word; try .slogan Granola")