summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2017-08-26 14:38:33 -0400
committerBarry Warsaw2017-08-26 14:38:33 -0400
commitf847e15407bfbf824236547bdf728a1ae00bd405 (patch)
tree78f6fe132c62dc15d19b312d1e59c52c19b1fc9a /src
parenta50062225076d6768859d6915ce7dff62e892b0d (diff)
downloadmailman-f847e15407bfbf824236547bdf728a1ae00bd405.tar.gz
mailman-f847e15407bfbf824236547bdf728a1ae00bd405.tar.zst
mailman-f847e15407bfbf824236547bdf728a1ae00bd405.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/bin/tests/test_mailman.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mailman/bin/tests/test_mailman.py b/src/mailman/bin/tests/test_mailman.py
index 54ee54bce..73941d468 100644
--- a/src/mailman/bin/tests/test_mailman.py
+++ b/src/mailman/bin/tests/test_mailman.py
@@ -25,8 +25,10 @@ from mailman.app.lifecycle import create_list
from mailman.bin.mailman import main
from mailman.config import config
from mailman.database.transaction import transaction
+from mailman.interfaces.command import ICLISubCommand
from mailman.testing.layers import ConfigLayer
from mailman.utilities.datetime import now
+from mailman.utilities.modules import add_components
from unittest.mock import patch
@@ -45,6 +47,14 @@ class TestMailmanCommand(unittest.TestCase):
# works. It does actually show the correct program when run from the
# command line.
self.assertEqual(lines[0], 'Usage: main [OPTIONS] COMMAND [ARGS]...')
+ # The help output includes a list of subcommands, in sorted order.
+ commands = {}
+ add_components('mailman.commands', ICLISubCommand, commands)
+ help_commands = list(
+ line.split()[0].strip()
+ for line in lines[-len(commands):]
+ )
+ self.assertEqual(sorted(commands), help_commands)
def test_mailman_command_with_bad_subcommand_prints_help(self):
# Issue #137: Running `mailman` without a subcommand raises an