diff options
author | 2022-05-29 15:56:46 +0100 | |
---|---|---|
committer | 2022-05-29 15:56:46 +0100 | |
commit | 381dfc1e7fd1849c3381971e9332f2fec20c7a7e (patch) | |
tree | b5f38e4228c8686ab85768cbba8f0b4f51d9effa /tests | |
parent | Ensure error uses correct maximum size (diff) |
Raise ValueError if max_length greater than allowed by paste service
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/utils/test_services.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/bot/utils/test_services.py b/tests/bot/utils/test_services.py index de166c813..e6b95be8e 100644 --- a/tests/bot/utils/test_services.py +++ b/tests/bot/utils/test_services.py @@ -82,3 +82,8 @@ class PasteTests(unittest.IsolatedAsyncioTestCase): contents = "a" * (MAX_PASTE_LENGTH+1) with self.assertRaises(PasteTooLongError): await send_to_paste_service(contents) + + async def test_raises_on_too_large_max_length(self): + """Ensure ValueError is raised if `max_length` passed is greater than `MAX_PASTE_LENGTH`.""" + with self.assertRaises(ValueError): + await send_to_paste_service("Hello World!", max_length=MAX_PASTE_LENGTH+1) |