aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-01-05 10:43:34 -0800
committerGravatar MarkKoz <[email protected]>2020-02-12 10:07:51 -0800
commite6bb9a79faad03ea7c3a373af84f707722da106f (patch)
tree8f75ab8fb3afe2cf2a7b04c644b231dc69f99cdd
parentSync tests: test that _send_prompt edits message contents (diff)
Sync tests: test that _send_prompt gets channel from cache
-rw-r--r--tests/bot/cogs/sync/test_base.py11
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 048d6c533..9b177f25c 100644
--- a/tests/bot/cogs/sync/test_base.py
+++ b/tests/bot/cogs/sync/test_base.py
@@ -2,6 +2,7 @@ import asyncio
import unittest
from bot.cogs.sync.syncers import Syncer
+from bot import constants
from tests import helpers
@@ -32,3 +33,13 @@ class SyncerBaseTests(unittest.TestCase):
msg.edit.assert_called_once()
self.assertIn("content", msg.edit.call_args[1])
+
+ def test_send_prompt_gets_channel_from_cache(self):
+ """The dev-core channel should be retrieved from cache 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())
+
+ self.bot.get_channel.assert_called_once_with(constants.Channels.devcore)