Added some tests
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 1m1s

This commit is contained in:
retoor 2024-11-28 11:43:09 +01:00
parent 4420b3a2d2
commit 6f856ad857
3 changed files with 8 additions and 0 deletions

View File

@ -14,3 +14,11 @@ class BotTestCase(unittest.TestCase):
def test_is_sus_rant_regex_match(self): def test_is_sus_rant_regex_match(self):
rant_text = "To learn more about our services or to schedule a consultation, contact us at +1 (604) 200-0581 today." rant_text = "To learn more about our services or to schedule a consultation, contact us at +1 (604) 200-0581 today."
self.assertTrue(self.bot.is_sus_rant(42, rant_text)) self.assertTrue(self.bot.is_sus_rant(42, rant_text))
def test_is_sus_rant_regex_url_match_dot_slash(self):
rant_text = "Visit Now: thesleepcompany.in/pages/all-chairs"
self.assertTrue(self.bot.is_sus_rant(42, rant_text))
def test_is_sus_rant_regex_url_match_http_or_www(self):
rant_text = "http:// www . google . nl"
self.assertTrue(self.bot.is_sus_rant(42, rant_text))