From 6a45e248aee3cc2d41990a143ebb367f8e072fbf Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 14 Jul 2017 13:27:28 -0400 Subject: [PATCH] ceph-volume: tets: use the new validation in conf Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/tests/test_configuration.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/tests/test_configuration.py b/src/ceph-volume/ceph_volume/tests/test_configuration.py index 5b7e51001a7..aad917a2d74 100644 --- a/src/ceph-volume/ceph_volume/tests/test_configuration.py +++ b/src/ceph-volume/ceph_volume/tests/test_configuration.py @@ -18,16 +18,19 @@ class TestConf(object): def test_get_non_existing_list(self): cfg = configuration.Conf() + cfg.is_valid = lambda: True cfg.readfp(self.conf_file) assert cfg.get_list('global', 'key') == [] def test_get_non_existing_list_get_default(self): cfg = configuration.Conf() + cfg.is_valid = lambda: True cfg.readfp(self.conf_file) assert cfg.get_list('global', 'key', ['a']) == ['a'] def test_get_rid_of_comments(self): cfg = configuration.Conf() + cfg.is_valid = lambda: True conf_file = StringIO(dedent(""" [foo] default = 0 # this is a comment @@ -38,6 +41,7 @@ class TestConf(object): def test_gets_split_on_commas(self): cfg = configuration.Conf() + cfg.is_valid = lambda: True conf_file = StringIO(dedent(""" [foo] default = 0,1,2,3 # this is a comment @@ -48,6 +52,7 @@ class TestConf(object): def test_spaces_and_tabs_are_ignored(self): cfg = configuration.Conf() + cfg.is_valid = lambda: True conf_file = StringIO(dedent(""" [foo] default = 0, 1, 2 ,3 # this is a comment @@ -61,7 +66,8 @@ class TestLoad(object): def test_path_does_not_exist(self): with pytest.raises(exceptions.ConfigurationError): - configuration.load('/path/does/not/exist/ceph.con') + conf = configuration.load('/path/does/not/exist/ceph.con') + conf.is_valid() def test_unable_to_read_configuration(self, tmpdir, capsys): ceph_conf = os.path.join(str(tmpdir), 'ceph.conf') -- 2.39.5