aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar S. Co1 <[email protected]>2020-02-25 12:47:09 -0500
committerGravatar S. Co1 <[email protected]>2020-02-25 12:50:42 -0500
commit284c1de321fea5927dafc1ac3192ad763bda3203 (patch)
treebf753927c71976f1dd4c62ec0f5bf1258a308fde
parentConfigure staff role & channel groupings in YAML (diff)
Fix mismatched constant names in syncer tests
-rw-r--r--bot/cogs/sync/syncers.py8
-rw-r--r--tests/bot/cogs/sync/test_base.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/bot/cogs/sync/syncers.py b/bot/cogs/sync/syncers.py
index 6715ad6fb..d6891168f 100644
--- a/bot/cogs/sync/syncers.py
+++ b/bot/cogs/sync/syncers.py
@@ -23,7 +23,7 @@ _Diff = namedtuple('Diff', ('created', 'updated', 'deleted'))
class Syncer(abc.ABC):
"""Base class for synchronising the database with objects in the Discord cache."""
- _CORE_DEV_MENTION = f"<@&{constants.Roles.core_developer}> "
+ _CORE_DEV_MENTION = f"<@&{constants.Roles.core_developers}> "
_REACTION_EMOJIS = (constants.Emojis.check_mark, constants.Emojis.cross_mark)
def __init__(self, bot: Bot) -> None:
@@ -54,12 +54,12 @@ class Syncer(abc.ABC):
# Send to core developers if it's an automatic sync.
if not message:
log.trace("Message not provided for confirmation; creating a new one in dev-core.")
- channel = self.bot.get_channel(constants.Channels.devcore)
+ channel = self.bot.get_channel(constants.Channels.dev_core)
if not channel:
log.debug("Failed to get the dev-core channel from cache; attempting to fetch it.")
try:
- channel = await self.bot.fetch_channel(constants.Channels.devcore)
+ channel = await self.bot.fetch_channel(constants.Channels.dev_core)
except HTTPException:
log.exception(
f"Failed to fetch channel for sending sync confirmation prompt; "
@@ -93,7 +93,7 @@ class Syncer(abc.ABC):
`author` of the prompt.
"""
# For automatic syncs, check for the core dev role instead of an exact author
- has_role = any(constants.Roles.core_developer == role.id for role in user.roles)
+ has_role = any(constants.Roles.core_developers == role.id for role in user.roles)
return (
reaction.message.id == message.id
and not user.bot
diff --git a/tests/bot/cogs/sync/test_base.py b/tests/bot/cogs/sync/test_base.py
index e6a6f9688..c2e143865 100644
--- a/tests/bot/cogs/sync/test_base.py
+++ b/tests/bot/cogs/sync/test_base.py
@@ -84,7 +84,7 @@ class SyncerSendPromptTests(unittest.TestCase):
mock_()
await self.syncer._send_prompt()
- method.assert_called_once_with(constants.Channels.devcore)
+ method.assert_called_once_with(constants.Channels.dev_core)
@helpers.async_test
async def test_send_prompt_returns_None_if_channel_fetch_fails(self):
@@ -135,7 +135,7 @@ class SyncerConfirmationTests(unittest.TestCase):
def setUp(self):
self.bot = helpers.MockBot()
self.syncer = TestSyncer(self.bot)
- self.core_dev_role = helpers.MockRole(id=constants.Roles.core_developer)
+ self.core_dev_role = helpers.MockRole(id=constants.Roles.core_developers)
@staticmethod
def get_message_reaction(emoji):