From d57db0b39b52b4660986e90d308434c823428b71 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sun, 5 Jan 2020 11:06:44 -0800 Subject: Sync tests: test _send_prompt sends a new message if one isn't given --- tests/bot/cogs/sync/test_base.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/bot/cogs/sync/test_base.py b/tests/bot/cogs/sync/test_base.py index 8eecea53f..f4ea33823 100644 --- a/tests/bot/cogs/sync/test_base.py +++ b/tests/bot/cogs/sync/test_base.py @@ -66,3 +66,14 @@ class SyncerBaseTests(unittest.TestCase): ret_val = asyncio.run(self.syncer._send_prompt()) self.assertIsNone(ret_val) + + def test_send_prompt_sends_new_message_if_not_given(self): + """A new message that mentions core devs should be sent if an extant message isn't given.""" + mock_channel = helpers.MockTextChannel() + mock_channel.send.return_value = helpers.MockMessage() + self.bot.get_channel.return_value = mock_channel + + asyncio.run(self.syncer._send_prompt()) + + mock_channel.send.assert_called_once() + self.assertIn(self.syncer._CORE_DEV_MENTION, mock_channel.send.call_args[0][0]) -- cgit v1.2.3