add nsfw test

master
mutantmonkey 2012-06-02 15:16:47 -07:00
parent f84eb9061c
commit 3dc958283b
1 changed files with 21 additions and 0 deletions

21
modules/test/test_nsfw.py Normal file
View File

@ -0,0 +1,21 @@
"""
test_nsfw.py - some things just aren't safe for work, the test cases
author: mutantmonkey <mutantmonkey@mutantmonkey.in>
"""
import re
import unittest
from mock import MagicMock, Mock
from modules.nsfw import nsfw
class TestNsfw(unittest.TestCase):
def setUp(self):
self.phenny = MagicMock()
def test_nsfw(self):
input = Mock(group=lambda x: "test")
nsfw(self.phenny, input)
self.phenny.say.assert_called_once_with(
"!!NSFW!! -> test <- !!NSFW!!")