aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-01-13 09:55:45 -0800
committerGravatar MarkKoz <[email protected]>2020-02-12 10:07:53 -0800
commitad402f5bc8f4db6b97f197fdb518a1b3e7f95eb5 (patch)
treecf14a3dbb7e96efe2e71b0e0f4a0aa751f6e97ed /tests
parentSync: fix precedence of conditional expression in _reaction_check (diff)
Sync tests: add messages to _reaction_check subtests
The message will be displayed by the test runner when a subtest fails.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/sync/test_base.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/bot/cogs/sync/test_base.py b/tests/bot/cogs/sync/test_base.py
index 43d72dda9..2d682faad 100644
--- a/tests/bot/cogs/sync/test_base.py
+++ b/tests/bot/cogs/sync/test_base.py
@@ -143,16 +143,21 @@ class SyncerConfirmationTests(unittest.TestCase):
def test_reaction_check_for_valid_emoji_and_authors(self):
"""Should return True if authors are identical or are a bot and a core dev, respectively."""
user_subtests = (
- (helpers.MockMember(id=77), helpers.MockMember(id=77)),
+ (
+ helpers.MockMember(id=77),
+ helpers.MockMember(id=77),
+ "identical users",
+ ),
(
helpers.MockMember(id=77, bot=True),
helpers.MockMember(id=43, roles=[self.core_dev_role]),
- )
+ "bot author and core-dev reactor",
+ ),
)
for emoji in self.syncer._REACTION_EMOJIS:
- for author, user in user_subtests:
- with self.subTest(author=author, user=user, emoji=emoji):
+ for author, user, msg in user_subtests:
+ with self.subTest(author=author, user=user, emoji=emoji, msg=msg):
message, reaction = self.get_message_reaction(emoji)
ret_val = self.syncer._reaction_check(author, message, reaction, user)