Adds profanity filter, fixes bugs.
[python_utils.git] / tests / profanity_filter_test.py
1 #!/usr/bin/env python3
2
3 import unittest
4
5 import profanity_filter as pf
6 import unittest_utils
7
8
9 class TestProfanityFilter(unittest.TestCase):
10
11     def test_basic_functionality(self):
12         p = pf.ProfanityFilter()
13         self.assertTrue(p.is_bad_word('shit'))
14         self.assertTrue(p.contains_bad_word('this is another fucking test'))
15         self.assertTrue(p.contains_bad_word('this is another fuckin test'))
16         self.assertFalse(p.contains_bad_word('Mary had a little lamb whose fleese was white as snow.'))
17
18
19 if __name__ == '__main__':
20     unittest.main()