]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: fix tests that do not fail as expected
authorLoic Dachary <loic@dachary.org>
Wed, 29 Jan 2014 13:52:22 +0000 (14:52 +0100)
committerLoic Dachary <loic@dachary.org>
Tue, 4 Feb 2014 07:06:26 +0000 (08:06 +0100)
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 <christophe.courtaut@gmail.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/pybind/test_ceph_argparse.py

index 89cf6c9a6a040a6c4354f9dd71906d9ae5c6c8e3..ca6bbfd6662ecc95cccf73a64aff499c6b723694 100755 (executable)
@@ -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-_.',