From 50e95fbf8b35526fb962393813ed74806b70c187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Mon, 7 Jan 2019 00:00:00 +0000 Subject: tests: Add a simple test case for help and update. --- tests/test-dconf.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/test-dconf.py b/tests/test-dconf.py index aa04ec7..51e522b 100755 --- a/tests/test-dconf.py +++ b/tests/test-dconf.py @@ -237,6 +237,9 @@ class DBusTest(unittest.TestCase): ['write', '/key', 'not-a-gvariant-value'], # Too many arguments: ['write', '/key', '1', '2'], + + # Too many arguments: + ['update', 'a', 'b'], ] for args in cases: @@ -245,6 +248,15 @@ class DBusTest(unittest.TestCase): dconf(*args, stderr=subprocess.PIPE) self.assertRegex(cm.exception.stderr, 'Usage:') + def test_help(self): + """Help show usage information on stdout and exits with success.""" + + stdout = dconf('help', 'write').stdout + self.assertRegex(stdout, 'dconf write KEY VALUE') + + stdout = dconf('help', 'help').stdout + self.assertRegex(stdout, 'dconf help COMMAND') + def test_read_nonexisiting(self): """Reading missing key produces no output. """ -- cgit v1.2.1