From cf0ce39d3e428c96ded83cd5c1689d4bcaa1fa59 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Thu, 31 May 2012 23:34:38 -0700 Subject: [PATCH] add test for short --- modules/test/test_short.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 modules/test/test_short.py diff --git a/modules/test/test_short.py b/modules/test/test_short.py new file mode 100644 index 0000000..3a16432 --- /dev/null +++ b/modules/test/test_short.py @@ -0,0 +1,22 @@ +""" +test_short.py - tests for the vtluug url shortener module +author: mutantmonkey +""" + +# add current working directory to path +import sys +sys.path.append('.') + +import unittest +from mock import MagicMock, Mock +from modules.short import short + +class TestShort(unittest.TestCase): + def setUp(self): + self.phenny = MagicMock() + + def test_short(self): + input = Mock(group=lambda x: 'http://vtluug.org/') + short(self.phenny, input) + + self.phenny.reply.assert_called_once_with('http://vtlu.ug/bLQYAy')