diff options
author | 2022-01-13 21:26:58 -0500 | |
---|---|---|
committer | 2022-01-13 21:26:58 -0500 | |
commit | b7e49a5fb1adb541db2cf5632a460a37ddda6d0a (patch) | |
tree | 17f0b74fb63e07398bfc3c69414fddeef8283958 /tests | |
parent | chore: Fix merge conflicts (diff) |
chore: Suppress output in the setup code, not the code that gets timed.
If multiple formatted codeblocks are passed to the command, the first one will be used as the setup code that does not get timed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/exts/utils/test_snekbox.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/bot/exts/utils/test_snekbox.py b/tests/bot/exts/utils/test_snekbox.py index cbffaa6b0..ebab71e71 100644 --- a/tests/bot/exts/utils/test_snekbox.py +++ b/tests/bot/exts/utils/test_snekbox.py @@ -61,7 +61,7 @@ class SnekboxTests(unittest.IsolatedAsyncioTestCase): ) for case, expected, testname in cases: with self.subTest(msg=f'Extract code from {testname}.'): - self.assertEqual(self.cog.prepare_input(case), expected) + self.assertEqual('\n'.join(self.cog.prepare_input(case)), expected) def test_get_results_message(self): """Return error and message according to the eval result.""" @@ -156,7 +156,7 @@ class SnekboxTests(unittest.IsolatedAsyncioTestCase): """Test the eval command procedure.""" ctx = MockContext() response = MockMessage() - self.cog.prepare_input = MagicMock(return_value='MyAwesomeFormattedCode') + self.cog.prepare_input = MagicMock(return_value=['MyAwesomeFormattedCode']) self.cog.send_eval = AsyncMock(return_value=response) self.cog.continue_eval = AsyncMock(return_value=None) @@ -297,7 +297,7 @@ class SnekboxTests(unittest.IsolatedAsyncioTestCase): actual = await self.cog.continue_eval(ctx, response) self.cog.get_code.assert_awaited_once_with(new_msg, ctx.command) - self.assertEqual(actual, expected) + self.assertEqual(actual, [expected]) self.bot.wait_for.assert_has_awaits( ( call( |