diff options
| author | 2020-01-05 11:06:44 -0800 | |
|---|---|---|
| committer | 2020-02-12 10:07:51 -0800 | |
| commit | d57db0b39b52b4660986e90d308434c823428b71 (patch) | |
| tree | 16f22c4e9de00940bcdd52087947d93a38e0c1b2 /tests | |
| parent | Sync tests: test _send_prompt returns None if channel fetch fails (diff) | |
Sync tests: test _send_prompt sends a new message if one isn't given
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bot/cogs/sync/test_base.py | 11 | 
1 files changed, 11 insertions, 0 deletions
| 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]) | 
