summaryrefslogtreecommitdiff
path: root/src/mailman/commands/tests/test_digests.py
diff options
context:
space:
mode:
authorBarry Warsaw2016-04-12 13:10:39 -0400
committerBarry Warsaw2016-04-12 13:10:39 -0400
commitd9384158c3f6e01ea7a0a42a40dd47c0892eb266 (patch)
treef3f9410fdfcbc3d26c194ef93809e3f708320f52 /src/mailman/commands/tests/test_digests.py
parent04dc2acf6c24a82db7a3de46c14a2b66d6ffc907 (diff)
downloadmailman-d9384158c3f6e01ea7a0a42a40dd47c0892eb266.tar.gz
mailman-d9384158c3f6e01ea7a0a42a40dd47c0892eb266.tar.zst
mailman-d9384158c3f6e01ea7a0a42a40dd47c0892eb266.zip
Diffstat (limited to 'src/mailman/commands/tests/test_digests.py')
-rw-r--r--src/mailman/commands/tests/test_digests.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mailman/commands/tests/test_digests.py b/src/mailman/commands/tests/test_digests.py
index b14820cbd..4c62cea38 100644
--- a/src/mailman/commands/tests/test_digests.py
+++ b/src/mailman/commands/tests/test_digests.py
@@ -41,6 +41,8 @@ class FakeArgs:
self.lists = []
self.send = False
self.bump = False
+ self.dry_run = False
+ self.verbose = False
class TestSendDigests(unittest.TestCase):
@@ -421,3 +423,29 @@ class TestBumpVolume(unittest.TestCase):
self.assertEqual(self._mlist.volume, 8)
self.assertEqual(self._mlist.next_digest_number, 1)
self.assertEqual(self._mlist.digest_last_sent_at, self.right_now)
+
+ def test_bump_verbose(self):
+ args = FakeArgs()
+ args.bump = True
+ args.verbose = True
+ args.lists.append('ant.example.com')
+ output = StringIO()
+ with patch('sys.stdout', output):
+ self._command.process(args)
+ self.assertMultiLineEqual(output.getvalue(), """\
+ant.example.com is at volume 7, number 4
+ant.example.com bumped to volume 7, number 5
+""")
+
+ def test_send_verbose(self):
+ args = FakeArgs()
+ args.send = True
+ args.verbose = True
+ args.dry_run = True
+ args.lists.append('ant.example.com')
+ output = StringIO()
+ with patch('sys.stdout', output):
+ self._command.process(args)
+ self.assertMultiLineEqual(output.getvalue(), """\
+ant.example.com sent volume 7, number 4
+""")