Since this thing is on the innerwebs I suppose it should have a
[python_utils.git] / tests / profanity_filter_test.py
1 #!/usr/bin/env python3
2
3 # © Copyright 2021-2022, Scott Gasch
4
5 """profanity_filter unittest, you fucker."""
6
7 import unittest
8
9 import profanity_filter as pf
10 import unittest_utils
11
12
13 class TestProfanityFilter(unittest.TestCase):
14     def test_basic_functionality(self):
15         p = pf.ProfanityFilter()
16         self.assertTrue(p.is_bad_word('shit'))
17         self.assertTrue(p.contains_bad_word('this is another fucking test'))
18         self.assertTrue(p.contains_bad_word('this is another fuckin test'))
19         self.assertFalse(
20             p.contains_bad_word('Mary had a little lamb whose fleese was white as snow.')
21         )
22
23
24 if __name__ == '__main__':
25     unittest.main()