diff options
author | 2024-11-23 21:13:33 +0000 | |
---|---|---|
committer | 2024-11-23 21:18:35 +0000 | |
commit | 7268e93a62245e119c1d4456ce5a9c141071f9d5 (patch) | |
tree | ea6351534b9a3d0f64cc3d0ed2caec5b20e3c085 | |
parent | Ensure we don't match to non-invite looking links (diff) |
Update invite regex test cases
-rw-r--r-- | tests/pydis_core/utils/test_regex.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/pydis_core/utils/test_regex.py b/tests/pydis_core/utils/test_regex.py index 1cf90711..79c1d743 100644 --- a/tests/pydis_core/utils/test_regex.py +++ b/tests/pydis_core/utils/test_regex.py @@ -35,8 +35,6 @@ class UtilsRegexTests(unittest.TestCase): self.assertEqual(match_regex("www.discord.com/invite/python"), "python") self.assertEqual(match_regex("discordapp.com/invite/python"), "python") self.assertEqual(match_regex("discord.me/python"), "python") - self.assertEqual(match_regex("discord.li/python"), "python") - self.assertEqual(match_regex("discord.io/python"), "python") self.assertEqual(match_regex(".gg/python"), "python") self.assertEqual(match_regex("discord.gg/python/but/extra"), "python/but/extra") @@ -56,9 +54,17 @@ class UtilsRegexTests(unittest.TestCase): self.assertEqual(match_regex("another string"), None) self.assertEqual(match_regex("https://pythondiscord.com"), None) + self.assertEqual(match_regex("https://tenor.com/view/cat-scream-cat-rage-gif-8639900204413677493"), None) + self.assertEqual(match_regex("https://paste.pythondiscord.com/1234"), None) self.assertEqual(match_regex("https://discord.com"), None) self.assertEqual(match_regex("https://discord.gg"), None) self.assertEqual(match_regex("https://discord.gg/ python"), None) + self.assertEqual(search_regex("https://discord.com/developers/applications"), None) + self.assertEqual( + search_regex( + "https://discord.com/channels/267624335836053506/305126844661760000/1309985927287930892" + ), None + ) self.assertEqual(search_regex("https://discord.com with whitespace"), None) self.assertEqual(search_regex(" https://discord.com "), None) |