aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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 9b177f25c..c18fa5fbb 100644
--- a/tests/bot/cogs/sync/test_base.py
+++ b/tests/bot/cogs/sync/test_base.py
@@ -43,3 +43,14 @@ class SyncerBaseTests(unittest.TestCase):
asyncio.run(self.syncer._send_prompt())
self.bot.get_channel.assert_called_once_with(constants.Channels.devcore)
+
+ def test_send_prompt_fetches_channel_if_cache_miss(self):
+ """The dev-core channel should be fetched with an API call if it's not in the cache."""
+ self.bot.get_channel.return_value = None
+ mock_channel = helpers.MockTextChannel()
+ mock_channel.send.return_value = helpers.MockMessage()
+ self.bot.fetch_channel.return_value = mock_channel
+
+ asyncio.run(self.syncer._send_prompt())
+
+ self.bot.fetch_channel.assert_called_once_with(constants.Channels.devcore)