]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_argparse: unit tests for validate_command config-key 588/head
authorLoic Dachary <loic@dachary.org>
Sun, 15 Sep 2013 15:43:11 +0000 (17:43 +0200)
committerLoic Dachary <loic@dachary.org>
Mon, 23 Sep 2013 21:46:44 +0000 (23:46 +0200)
http://tracker.ceph.com/issues/6274 refs #6274

Reviewed-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/pybind/test_ceph_argparse.py

index 522950516d1e8e0126e1c6a6e885c487c8c99c7f..85af54d6f75c0a6f5ec2caa8bb861a1672f81ed1 100755 (executable)
@@ -1004,6 +1004,31 @@ class TestOSD(TestArgparse):
                                                     'remove-overlay',
                                                     'poolname',
                                                     'toomany']))
+
+
+class TestConfigKey(TestArgparse):
+
+    def test_get(self):
+        self.check_1_string_arg('config-key', 'get')
+
+    def test_put(self):
+        self.assert_valid_command(['config-key', 'put',
+                                   'key'])
+        self.assert_valid_command(['config-key', 'put',
+                                   'key', 'value'])
+        assert_equal({}, validate_command(sigdict, ['config-key', 'put']))
+        assert_equal({}, validate_command(sigdict, ['config-key', 'put',
+                                                    'key', 'value',
+                                                    'toomany']))
+
+    def test_del(self):
+        self.check_1_string_arg('config-key', 'del')
+
+    def test_exists(self):
+        self.check_1_string_arg('config-key', 'exists')
+
+    def test_list(self):
+        self.check_no_arg('config-key', 'list')
 # Local Variables:
 # compile-command: "cd ../.. ; make -j4 && 
 #  PYTHONPATH=pybind nosetests --stop \