def test_ceph_conf(): conf = ceph_conf.CephConf(context_wrap(CEPH_CONF)) assert list(conf.sections()) == [ 'global', 'osd', 'mon.controller1-az2', 'client.radosgw.gateway' ] assert conf.has_option('osd', 'osd_journal_size') is True assert conf.getboolean('client.radosgw.gateway', 'rgw_swift_account_in_url') is True assert conf.get('client.radosgw.gateway', 'rgw_swift_account_in_url') == 'true' assert conf.get('client.radosgw.gateway', 'user') == 'apache' assert conf.get('client.radosgw.gateway', 'log_file') == '/var/log/ceph/radosgw.log'
def test_ceph_conf_documentation(): failed_count, tests = doctest.testmod( ceph_conf, globs={'conf': ceph_conf.CephConf(context_wrap(CEPH_CONF))}) assert failed_count == 0
def test_ceph_conf_empty(): with pytest.raises(SkipException): assert ceph_conf.CephConf(context_wrap('')) is None