From b843703134a166013518c707fa5a77373f1bf0bf Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Thu, 5 Aug 2021 14:56:34 -0700 Subject: Adds profanity filter, fixes bugs. --- tests/profanity_filter_test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 tests/profanity_filter_test.py (limited to 'tests') 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() -- cgit v1.3