]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-volume: tets: use the new validation in conf
authorAlfredo Deza <adeza@redhat.com>
Fri, 14 Jul 2017 17:27:28 +0000 (13:27 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 4 Aug 2017 14:25:58 +0000 (10:25 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/tests/test_configuration.py

index 5b7e51001a75cd9092889c1012c0ec2bf3be1ce5..aad917a2d74058424ff91e66c996fcae24c17092 100644 (file)
@@ -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')