From d020e5ebaf72448b015351b550ea3c82bde3c61f Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Wed, 8 Jan 2020 16:42:01 -0800 Subject: Sync tests: create a separate test case for _send_prompt tests --- tests/bot/cogs/sync/test_base.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/bot/cogs/sync/test_base.py b/tests/bot/cogs/sync/test_base.py index 4c3eae1b3..af15b544b 100644 --- a/tests/bot/cogs/sync/test_base.py +++ b/tests/bot/cogs/sync/test_base.py @@ -20,6 +20,18 @@ class TestSyncer(Syncer): class SyncerBaseTests(unittest.TestCase): """Tests for the syncer base class.""" + def setUp(self): + self.bot = helpers.MockBot() + + def test_instantiation_fails_without_abstract_methods(self): + """The class must have abstract methods implemented.""" + with self.assertRaisesRegex(TypeError, "Can't instantiate abstract class"): + Syncer(self.bot) + + +class SyncerSendPromptTests(unittest.TestCase): + """Tests for sending the sync confirmation prompt.""" + def setUp(self): self.bot = helpers.MockBot() self.syncer = TestSyncer(self.bot) @@ -49,11 +61,6 @@ class SyncerBaseTests(unittest.TestCase): return mock_channel, mock_message - def test_instantiation_fails_without_abstract_methods(self): - """The class must have abstract methods implemented.""" - with self.assertRaisesRegex(TypeError, "Can't instantiate abstract class"): - Syncer(self.bot) - def test_send_prompt_edits_and_returns_message(self): """The given message should be edited to display the prompt and then should be returned.""" msg = helpers.MockMessage() -- cgit v1.2.3