Fixed the tests.

master
Calvin Winkowski 2014-04-25 17:15:33 -04:00
parent b9f0da7d74
commit 9248b6721c
1 changed files with 10 additions and 1 deletions

View File

@ -42,13 +42,22 @@ class TestTfw(unittest.TestCase):
def test_mev(self): def test_mev(self):
input = Mock(group=lambda x: '24060') input = Mock(group=lambda x: '24060')
tfw.tfw(self.phenny, input) tfw.tfweV(self.phenny, input)
out = self.phenny.say.call_args[0][0] out = self.phenny.say.call_args[0][0]
m = re.match('^[\-\d\.]+ meV‽ .* \- .* \- [A-Z]{4} \d{2}:\d{2}Z$', out, m = re.match('^[\-\d\.]+ meV‽ .* \- .* \- [A-Z]{4} \d{2}:\d{2}Z$', out,
flags=re.UNICODE) flags=re.UNICODE)
self.assertTrue(m) self.assertTrue(m)
def test_meter(self):
input = Mock(group=lambda x: '24060')
tfw.tfw(self.phenny, input)
out = self.phenny.say.call_args[0][0]
m = re.match('^[\-\d\.]+ Meters‽ .* \- .* \- [A-Z]{4} \d{2}:\d{2}Z$', out,
flags=re.UNICODE)
self.assertTrue(m)
def test_sexy_time(self): def test_sexy_time(self):
input = Mock(group=lambda x: 'KBCB') input = Mock(group=lambda x: 'KBCB')
tfw.web = MagicMock() tfw.web = MagicMock()