diff options
author | 2023-06-22 22:33:50 +0100 | |
---|---|---|
committer | 2023-07-11 15:45:09 +0100 | |
commit | d961f5e2cc89c6c2a30b923756e3304d65f1ae28 (patch) | |
tree | d8961c450f00e77b2b3e08918e9dfc83da86819f /tests | |
parent | Remove unneeded paste service constant (diff) |
Mock _lexers_supported_by_pastebin in test to ensure no call to external service is made
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/exts/utils/snekbox/test_snekbox.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/bot/exts/utils/snekbox/test_snekbox.py b/tests/bot/exts/utils/snekbox/test_snekbox.py index 6d9b6b1e4..200aa5a20 100644 --- a/tests/bot/exts/utils/snekbox/test_snekbox.py +++ b/tests/bot/exts/utils/snekbox/test_snekbox.py @@ -55,6 +55,10 @@ class SnekboxTests(unittest.IsolatedAsyncioTestCase): ) resp.json.assert_awaited_once() + @patch( + "bot.exts.utils.snekbox._cog.paste_service._lexers_supported_by_pastebin", + {"https://paste.pythondiscord.com": ["text"]}, + ) async def test_upload_output_reject_too_long(self): """Reject output longer than MAX_PASTE_LENGTH.""" result = await self.cog.upload_output("-" * (MAX_PASTE_SIZE + 1)) |