From 6aef5cab6f266bccb5d49c4d912ee374b23c3300 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Thu, 31 May 2012 00:55:31 -0700 Subject: [PATCH] add wuvt test --- modules/test/test_wuvt.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 modules/test/test_wuvt.py diff --git a/modules/test/test_wuvt.py b/modules/test/test_wuvt.py new file mode 100644 index 0000000..e89c5f9 --- /dev/null +++ b/modules/test/test_wuvt.py @@ -0,0 +1,25 @@ +""" +test_wuvt.py - tests for the wuvt module +author: mutantmonkey +""" + +# add current working directory to path +import sys +sys.path.append('.') + +import re +import unittest +from mock import MagicMock, Mock +from modules.wuvt import wuvt + +class TestWuvt(unittest.TestCase): + def setUp(self): + self.phenny = MagicMock() + + def test_wuvt(self): + wuvt(self.phenny, None) + + out = self.phenny.reply.call_args[0][0] + m = re.match('^DJ .* is currently playing: .* by .*$', out, + flags=re.UNICODE) + self.assertTrue(m)