Beispiel #1
0
def test_deprecated_config():
    cfg = Config()
    cfg.ServerApp.token = token = "asdf"
    cfg.ServerApp.password = password = passwd("secrets")
    app = ServerApp(config=cfg)
    app.initialize([])
    app.init_configurables()
    assert app.identity_provider.token == token
    assert app.token == token
    assert app.identity_provider.hashed_password == password
    assert app.password == password
Beispiel #2
0
def test_deprecated_config_priority():
    cfg = Config()
    cfg.ServerApp.token = "ignored"
    cfg.IdentityProvider.token = token = "idp_token"
    cfg.ServerApp.password = passwd("ignored")
    cfg.PasswordIdentityProvider.hashed_password = password = passwd("used")
    app = ServerApp(config=cfg)
    app.initialize([])
    app.init_configurables()
    assert app.identity_provider.token == token
    assert app.identity_provider.hashed_password == password