catfacts test and test cleanup

master
mutantmonkey 2012-06-02 01:13:50 -07:00
parent f995769b6f
commit 6fece14639
5 changed files with 25 additions and 5 deletions

View File

@ -0,0 +1,22 @@
"""
test_catfacts.py - tests for the cat facts module
author: mutantmonkey <mutantmonkey@mutantmonkey.in>
"""
import re
import unittest
from mock import MagicMock
from modules.catfacts import catfacts
class TestCatfacts(unittest.TestCase):
def setUp(self):
self.phenny = MagicMock()
def test_catfacts(self):
catfacts(self.phenny, None)
out = self.phenny.reply.call_args[0][0]
m = re.match('^.* \(#[0-9]+\)$', out,
flags=re.UNICODE)
self.assertTrue(m)

View File

@ -4,7 +4,7 @@ author: mutantmonkey <mutantmonkey@mutantmonkey.in>
"""
import unittest
from mock import MagicMock, Mock
from mock import MagicMock
from modules.commit import commit

View File

@ -4,7 +4,7 @@ author: mutantmonkey <mutantmonkey@mutantmonkey.in>
"""
import unittest
from mock import MagicMock, Mock
from mock import MagicMock
from modules import mylife

View File

@ -21,5 +21,3 @@ class TestNodeTodo(unittest.TestCase):
m = re.match('^http://node-todobin\.herokuapp\.com/list/[a-z0-9]+$',
out, flags=re.UNICODE)
self.assertTrue(m)

View File

@ -9,7 +9,7 @@ sys.path.append('.')
import re
import unittest
from mock import MagicMock, Mock
from mock import MagicMock
from modules.wuvt import wuvt
class TestWuvt(unittest.TestCase):