summaryrefslogtreecommitdiff
path: root/src/mailman/commands/tests/test_conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/commands/tests/test_conf.py')
-rw-r--r--src/mailman/commands/tests/test_conf.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mailman/commands/tests/test_conf.py b/src/mailman/commands/tests/test_conf.py
index bca7fe72f..307151c74 100644
--- a/src/mailman/commands/tests/test_conf.py
+++ b/src/mailman/commands/tests/test_conf.py
@@ -31,6 +31,7 @@ import mock
import tempfile
import unittest
+from StringIO import StringIO
from mailman.commands.cli_conf import Conf
from mailman.testing.layers import ConfigLayer
@@ -40,6 +41,7 @@ class FakeArgs:
section = None
key = None
output = None
+ sort = False
class FakeParser:
@@ -99,3 +101,13 @@ class TestConf(unittest.TestCase):
finally:
os.remove(filename)
self.assertEqual(contents, 'no\n')
+
+ def test_sort_by_section(self):
+ self.args.output = '-'
+ self.args.sort = True
+ output = StringIO()
+ with mock.patch('sys.stdout', output):
+ self.command.process(self.args)
+ last_line = ''
+ for line in output.getvalue().splitlines():
+ self.assertTrue(line > last_line)