From 1cdaa4c16dfcbb6db31adb177a18b8132052135d Mon Sep 17 00:00:00 2001 From: duogenesis <136373989+duogenesis@users.noreply.github.com> Date: Wed, 1 Jan 2025 13:31:57 +1100 Subject: [PATCH] Add tests --- antiabuse/antirude/displayname/test_init.py | 34 +++++++++++++++++++++ antiabuse/antirude/profile/test_init.py | 3 ++ 2 files changed, 37 insertions(+) create mode 100644 antiabuse/antirude/displayname/test_init.py diff --git a/antiabuse/antirude/displayname/test_init.py b/antiabuse/antirude/displayname/test_init.py new file mode 100644 index 0000000..872c9ef --- /dev/null +++ b/antiabuse/antirude/displayname/test_init.py @@ -0,0 +1,34 @@ +import unittest +from antiabuse.antirude.displayname import is_rude + +class TestIsRude(unittest.TestCase): + + def test_rude_strings(self): + self.assertTrue( + is_rude("You're a nigg")) + + self.assertTrue( + is_rude("You're a 𝖓𝖎𝖌𝖌𝖊𝖗")) + + self.assertTrue( + is_rude("ywnbaw is an acronym")) + + def test_inrude_strings(self): + self.assertFalse( + is_rude("go hug urself please")) + + self.assertFalse( + is_rude("I respect you")) + + self.assertFalse( + is_rude("Who're you listening to?")) + + self.assertFalse( + is_rude("Can u c my pfp?")) + + self.assertFalse( + is_rude("I am therapist")) + + +if __name__ == '__main__': + unittest.main() diff --git a/antiabuse/antirude/profile/test_init.py b/antiabuse/antirude/profile/test_init.py index d022f0b..5c846dc 100644 --- a/antiabuse/antirude/profile/test_init.py +++ b/antiabuse/antirude/profile/test_init.py @@ -7,6 +7,9 @@ def test_rude_strings(self): self.assertTrue( is_rude("You're a nigg")) + self.assertTrue( + is_rude("You're a 𝖓𝖎𝖌𝖌𝖊𝖗")) + self.assertTrue( is_rude("ywnbaw is an acronym"))