From ad09023e1bdb19412c0205b4567c460bf3a45eaa Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Wed, 29 Jan 2014 14:52:22 +0100 Subject: [PATCH] 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 --- src/test/pybind/test_ceph_argparse.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/pybind/test_ceph_argparse.py b/src/test/pybind/test_ceph_argparse.py index 89cf6c9a6a0..ca6bbfd6662 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-_.', -- 2.47.3