phenny/modules/test/test_nsfw.py

27 lines
730 B
Python
Raw Normal View History

2012-06-02 18:16:47 -04:00
"""
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)
2013-08-25 17:32:42 -04:00
self.phenny.say.assert_called_once_with(
"!!NSFW!! -> test <- !!NSFW!!")
2012-06-02 18:16:47 -04:00
2013-08-25 17:32:42 -04:00
def test_nsfw_none(self):
input = Mock(group=lambda x: None)
nsfw(self.phenny, input)
2012-06-02 18:16:47 -04:00
self.phenny.say.assert_called_once_with(
2013-08-25 17:32:42 -04:00
".nsfw <link> - for when a link isn't safe for work")