rename nodetodo and add test

master
mutantmonkey 2012-06-02 00:31:02 -07:00
parent f54aec3fcd
commit 743d92700c
2 changed files with 26 additions and 1 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
""" """
node-todo.py - node-todo uploader nodetodo.py - node-todo uploader
author: mutantmonkey <mutantmonkey@mutantmonkey.in> author: mutantmonkey <mutantmonkey@mutantmonkey.in>
author: telnoratti <calvin@winkowski.me> author: telnoratti <calvin@winkowski.me>
""" """

View File

@ -0,0 +1,25 @@
"""
test_nodetodo.py - tests for the node-todo xss module
author: mutantmonkey <mutantmonkey@mutantmonkey.in>
"""
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)