Exemple #1
0
def test_logging_config():
    from ldap2pg.config import Configuration

    config = Configuration()

    config['verbose'] = True
    l = config.logging_dict()
    assert 'DEBUG' == l['loggers']['ldap2pg']['level']

    config['verbose'] = False
    l = config.logging_dict()
    assert 'INFO' == l['loggers']['ldap2pg']['level']
Exemple #2
0
def test_logging_config():
    from ldap2pg.config import Configuration, UserError

    config = Configuration()

    config['verbosity'] = 'DEBUG'
    dict_ = config.logging_dict()
    assert 'DEBUG' == dict_['loggers']['ldap2pg']['level']

    with pytest.raises(UserError):
        config.bootstrap(environ=dict(VERBOSITY='TOTO'))