summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2021-08-05 14:56:34 -0700
committerScott Gasch <[email protected]>2021-08-05 14:56:34 -0700
commitb843703134a166013518c707fa5a77373f1bf0bf (patch)
treeedd85dee1f0ca34d7720ff8dc44b7a1b1bcc85a0 /tests
parenta08ca309cb5bd7971210a9247a38c9bbe376a6e6 (diff)
Adds profanity filter, fixes bugs.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/profanity_filter_test.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/profanity_filter_test.py b/tests/profanity_filter_test.py
new file mode 100755
index 0000000..5648ad3
--- /dev/null
+++ b/tests/profanity_filter_test.py
@@ -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()