diff options
| author | Barry Warsaw | 2011-10-16 15:31:28 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2011-10-16 15:31:28 -0400 |
| commit | a8b8be8ad7510c095c3232c25f2c2e3e54d44352 (patch) | |
| tree | a44d5202941b6bc59177bfe86a33f3a216870bd6 /src/mailman/commands/tests/test_create.py | |
| parent | 24c3bafeb6551aa52a2df3c1b151b4bde07c3de0 (diff) | |
| download | mailman-a8b8be8ad7510c095c3232c25f2c2e3e54d44352.tar.gz mailman-a8b8be8ad7510c095c3232c25f2c2e3e54d44352.tar.zst mailman-a8b8be8ad7510c095c3232c25f2c2e3e54d44352.zip | |
Diffstat (limited to 'src/mailman/commands/tests/test_create.py')
| -rw-r--r-- | src/mailman/commands/tests/test_create.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mailman/commands/tests/test_create.py b/src/mailman/commands/tests/test_create.py index c2176a106..76a8e0e00 100644 --- a/src/mailman/commands/tests/test_create.py +++ b/src/mailman/commands/tests/test_create.py @@ -25,6 +25,7 @@ __all__ = [ ] +import sys import unittest from mailman.app.lifecycle import create_list @@ -48,6 +49,7 @@ class FakeParser: def error(self, message): self.message = message + sys.exit(1) @@ -65,14 +67,20 @@ class TestCreate(unittest.TestCase): # Cannot create a mailing list if it already exists. create_list('test@example.com') self.args.listname = ['test@example.com'] - self.command.process(self.args) + try: + self.command.process(self.args) + except SystemExit: + pass self.assertEqual(self.command.parser.message, 'List already exists: test@example.com') def test_invalid_posting_address(self): # Cannot create a mailing list with an invalid posting address. self.args.listname = ['foo'] - self.command.process(self.args) + try: + self.command.process(self.args) + except SystemExit: + pass self.assertEqual(self.command.parser.message, 'Illegal list name: foo') @@ -81,7 +89,10 @@ class TestCreate(unittest.TestCase): self.args.listname = ['test@example.com'] self.args.domain = True self.args.owners = ['main=True'] - self.command.process(self.args) + try: + self.command.process(self.args) + except SystemExit: + pass self.assertEqual(self.command.parser.message, 'Illegal owner addresses: main=True') |
