Adds profanity filter, fixes bugs.
[python_utils.git] / tests / profanity_filter_test.py
diff --git a/tests/profanity_filter_test.py b/tests/profanity_filter_test.py
new file mode 100755 (executable)
index 0000000..5648ad3
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+
+import unittest
+
+import profanity_filter as pf
+import unittest_utils
+
+
+class TestProfanityFilter(unittest.TestCase):
+
+    def test_basic_functionality(self):
+        p = pf.ProfanityFilter()
+        self.assertTrue(p.is_bad_word('shit'))
+        self.assertTrue(p.contains_bad_word('this is another fucking test'))
+        self.assertTrue(p.contains_bad_word('this is another fuckin test'))
+        self.assertFalse(p.contains_bad_word('Mary had a little lamb whose fleese was white as snow.'))
+
+
+if __name__ == '__main__':
+    unittest.main()