fix .head for errors and add test

This commit is contained in:
mutantmonkey
2013-07-20 22:25:45 -07:00
parent 5eaea6a449
commit 899d063071
2 changed files with 11 additions and 1 deletions

View File

@@ -21,6 +21,13 @@ class TestHead(unittest.TestCase):
'\d{2}:\d{2}:\d{2} UTC, [0-9\.]+ s$', out, flags=re.UNICODE)
self.assertTrue(m)
def test_head_404(self):
input = Mock(group=lambda x: 'http://vtluug.org/trigger_404')
head(self.phenny, input)
out = self.phenny.say.call_args[0][0]
self.assertEqual(out, '404')
def test_header(self):
input = Mock(group=lambda x: 'http://vtluug.org Server')
head(self.phenny, input)