aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-01-20 09:24:46 -0800
committerGravatar MarkKoz <[email protected]>2020-02-12 10:07:54 -0800
commit7692d506454d5aa125135eac17ed291cc160ef2b (patch)
treebb5f3218a723b047a7ff7a26d85722ba55c616ed /tests
parentSync tests: test diff size calculation (diff)
Sync tests: test sync edits the message if one was sent
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/sync/test_base.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/bot/cogs/sync/test_base.py b/tests/bot/cogs/sync/test_base.py
index 6d784d0de..ae8e53ffa 100644
--- a/tests/bot/cogs/sync/test_base.py
+++ b/tests/bot/cogs/sync/test_base.py
@@ -303,3 +303,18 @@ class SyncerSyncTests(unittest.TestCase):
self.syncer._get_diff.assert_called_once_with(guild)
self.syncer._get_confirmation_result.assert_called_once()
self.assertEqual(self.syncer._get_confirmation_result.call_args[0][0], size)
+
+ def test_sync_message_edited(self):
+ """The message should be edited if one was sent."""
+ for message in (helpers.MockMessage(), None):
+ with self.subTest(message=message):
+ self.syncer._get_confirmation_result = helpers.AsyncMock(
+ return_value=(True, message)
+ )
+
+ guild = helpers.MockGuild()
+ asyncio.run(self.syncer.sync(guild))
+
+ if message is not None:
+ message.edit.assert_called_once()
+ self.assertIn("content", message.edit.call_args[1])