diff options
Diffstat (limited to 'src/mailman/commands/docs/status.rst')
| -rw-r--r-- | src/mailman/commands/docs/status.rst | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/mailman/commands/docs/status.rst b/src/mailman/commands/docs/status.rst index 7587157bc..1824e1717 100644 --- a/src/mailman/commands/docs/status.rst +++ b/src/mailman/commands/docs/status.rst @@ -6,32 +6,27 @@ The status of the Mailman master process can be queried from the command line. It's clear at this point that nothing is running. :: - >>> from mailman.commands.cli_status import Status - >>> status = Status() - - >>> class FakeArgs: - ... pass + >>> command = cli('mailman.commands.cli_status.status') The status is printed to stdout and a status code is returned. - >>> status.process(FakeArgs) + >>> command('mailman status') GNU Mailman is not running - 0 We can simulate the master starting up by acquiring its lock. >>> from flufl.lock import Lock >>> lock = Lock(config.LOCK_FILE) >>> lock.lock() + >>> ignore = cleanups.callback(lock.unlock, unconditionally=True) Getting the status confirms that the master is running. - >>> status.process(FakeArgs) + >>> command('mailman status') GNU Mailman is running (master pid: ... We shut down the master and confirm the status. - >>> lock.unlock() - >>> status.process(FakeArgs) + >>> lock.unlock(unconditionally=True) + >>> command('mailman status') GNU Mailman is not running - 0 |
