diff options
author | Loic Dachary <loic@dachary.org> | 2013-09-15 17:43:11 +0200 |
---|---|---|
committer | Loic Dachary <loic@dachary.org> | 2013-09-23 23:46:44 +0200 |
commit | bfd4db2525b37f52a90c74deb8233edb60cc5d97 (patch) | |
tree | f29631577c56418a627c06411c1474911a3b1ae0 | |
parent | fa396d9461e0db19c7be3e7fa9481f6f64a009cf (diff) | |
download | ceph-bfd4db2525b37f52a90c74deb8233edb60cc5d97.tar.gz |
ceph_argparse: unit tests for validate_command config-key
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>
-rwxr-xr-x | src/test/pybind/test_ceph_argparse.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/pybind/test_ceph_argparse.py b/src/test/pybind/test_ceph_argparse.py index 522950516d1..85af54d6f75 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 \ |