summaryrefslogtreecommitdiff
path: root/tests/test-dconf.py
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2019-01-07 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2019-01-29 15:48:54 +0100
commit50e95fbf8b35526fb962393813ed74806b70c187 (patch)
tree8465e0353d224d90fd3208ca24ecc6422f3818aa /tests/test-dconf.py
parentd36936fe111147db6ca2cd890ecec48a74ae343a (diff)
downloaddconf-50e95fbf8b35526fb962393813ed74806b70c187.tar.gz
tests: Add a simple test case for help and update.
Diffstat (limited to 'tests/test-dconf.py')
-rwxr-xr-xtests/test-dconf.py12
1 files changed, 12 insertions, 0 deletions
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. """