aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-03-09 13:56:58 -0700
committerGravatar MarkKoz <[email protected]>2020-03-13 17:11:05 -0700
commit0358121687988159cb6754e249eed1ee2d40a783 (patch)
treec9037e35f7d60478d6e237e445f8f4ff1bbb5245 /tests
parentCog tests: add a function to get all cogs (diff)
Cog tests: add a function to get all qualified names for a cmd
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/test_cogs.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/bot/cogs/test_cogs.py b/tests/bot/cogs/test_cogs.py
index 4290c279c..e28717756 100644
--- a/tests/bot/cogs/test_cogs.py
+++ b/tests/bot/cogs/test_cogs.py
@@ -35,3 +35,11 @@ class CommandNameTests(unittest.TestCase):
for name, cls in extension.__dict__.items():
if isinstance(cls, commands.Cog):
yield getattr(extension, name)
+
+ @staticmethod
+ def get_qualified_names(command: commands.Command) -> t.List[str]:
+ """Return a list of all qualified names, including aliases, for the `command`."""
+ names = [f"{command.full_parent_name} {alias}" for alias in command.aliases]
+ names.append(command.qualified_name)
+
+ return names