diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/profanity_filter_test.py | 20 |
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() |
