diff --git a/modules/node-todo.py b/modules/nodetodo.py similarity index 95% rename from modules/node-todo.py rename to modules/nodetodo.py index b8263f5..686c16e 100644 --- a/modules/node-todo.py +++ b/modules/nodetodo.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 """ -node-todo.py - node-todo uploader +nodetodo.py - node-todo uploader author: mutantmonkey author: telnoratti """ diff --git a/modules/test/test_nodetodo.py b/modules/test/test_nodetodo.py new file mode 100644 index 0000000..7ac1851 --- /dev/null +++ b/modules/test/test_nodetodo.py @@ -0,0 +1,25 @@ +""" +test_nodetodo.py - tests for the node-todo xss module +author: mutantmonkey +""" + +import re +import unittest +from mock import MagicMock, Mock +from modules.nodetodo import xss, urlshortener + + +class TestNodeTodo(unittest.TestCase): + def setUp(self): + self.phenny = MagicMock() + + def test_xss(self): + input = Mock(group=lambda x: 'http://vtluug.org/') + xss(self.phenny, input) + + out = self.phenny.reply.call_args[0][0] + m = re.match('^http://node-todobin\.herokuapp\.com/list/[a-z0-9]+$', + out, flags=re.UNICODE) + self.assertTrue(m) + +