From: Loic Dachary Date: Wed, 29 Jan 2014 13:52:22 +0000 (+0100) Subject: pybind: fix tests that do not fail as expected X-Git-Tag: v0.78~226^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad09023e1bdb19412c0205b4567c460bf3a45eaa;p=ceph.git pybind: fix tests that do not fail as expected A missing argument make the test fail indeed, but the intended test is to demonstrate something else ( either character validation or excess of arguments etc. ). The result is {} instead of None which is what should have been expected in the first place. Ideally there would be a more verbose way to check for syntactic errors to make such mistakes less probable. Reviewed-By: Christophe Courtaut Signed-off-by: Loic Dachary --- diff --git a/src/test/pybind/test_ceph_argparse.py b/src/test/pybind/test_ceph_argparse.py index 89cf6c9a6a04..ca6bbfd6662e 100755 --- a/src/test/pybind/test_ceph_argparse.py +++ b/src/test/pybind/test_ceph_argparse.py @@ -695,37 +695,38 @@ class TestOSD(TestArgparse): tunable]) assert_equal({}, validate_command(sigdict, ['osd', 'crush', 'tunables'])) - assert_equal(None, validate_command(sigdict, ['osd', 'crush', + assert_equal({}, validate_command(sigdict, ['osd', 'crush', + 'tunables', 'default', 'toomany'])) def test_crush_rule_create_simple(self): self.assert_valid_command(['osd', 'crush', 'rule', 'create-simple', 'AZaz09-_.', 'AZaz09-_.', 'AZaz09-_.']) - assert_equal(None, validate_command(sigdict, ['osd', 'crush', + assert_equal({}, validate_command(sigdict, ['osd', 'crush', 'rule', 'create-simple'])) - assert_equal(None, validate_command(sigdict, ['osd', 'crush', + assert_equal({}, validate_command(sigdict, ['osd', 'crush', 'rule', 'create-simple', 'AZaz09-_.'])) - assert_equal(None, validate_command(sigdict, ['osd', 'crush', + assert_equal({}, validate_command(sigdict, ['osd', 'crush', 'rule', 'create-simple', 'AZaz09-_.', 'AZaz09-_.'])) - assert_equal(None, validate_command(sigdict, ['osd', 'crush', + assert_equal({}, validate_command(sigdict, ['osd', 'crush', 'rule', 'create-simple', '!!!', 'AZaz09-_.', 'AZaz09-_.'])) - assert_equal(None, validate_command(sigdict, ['osd', 'crush', + assert_equal({}, validate_command(sigdict, ['osd', 'crush', 'rule', 'create-simple', 'AZaz09-_.', '|||', 'AZaz09-_.'])) - assert_equal(None, validate_command(sigdict, ['osd', 'crush', + assert_equal({}, validate_command(sigdict, ['osd', 'crush', 'rule', 'create-simple', 'AZaz09-_.', 'AZaz09-_.', '+++'])) - assert_equal(None, validate_command(sigdict, ['osd', 'crush', + assert_equal({}, validate_command(sigdict, ['osd', 'crush', 'rule', 'create-simple', 'AZaz09-_.', 'AZaz09-_.',