From bfd4db2525b37f52a90c74deb8233edb60cc5d97 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 15 Sep 2013 17:43:11 +0200 Subject: [PATCH] ceph_argparse: unit tests for validate_command config-key http://tracker.ceph.com/issues/6274 refs #6274 Reviewed-by: Dan Mick Reviewed-by: Joao Eduardo Luis Signed-off-by: Loic Dachary --- src/test/pybind/test_ceph_argparse.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/test/pybind/test_ceph_argparse.py b/src/test/pybind/test_ceph_argparse.py index 522950516d1e..85af54d6f75c 100755 --- a/src/test/pybind/test_ceph_argparse.py +++ b/src/test/pybind/test_ceph_argparse.py @@ -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 \ -- 2.47.3