Ejemplo n.º 1
0
def test_server_password(tmp_path, configurable_serverapp):
    password = '******'
    with patch.dict('os.environ',
                    {'JUPYTER_CONFIG_DIR': str(tmp_path)}), patch.object(
                        getpass, 'getpass', return_value=password):
        app = JupyterPasswordApp(log_level=logging.ERROR)
        app.initialize([])
        app.start()
        sv = configurable_serverapp()
        sv.load_config_file()
        assert sv.password != ''
        passwd_check(sv.password, password)
def test_server_password(tmp_path, jp_configurable_serverapp):
    password = "******"
    with patch.dict("os.environ",
                    {"JUPYTER_CONFIG_DIR": str(tmp_path)}), patch.object(
                        getpass, "getpass", return_value=password):
        app = JupyterPasswordApp(log_level=logging.ERROR)
        app.initialize([])
        app.start()
        sv = jp_configurable_serverapp()
        sv.load_config_file()
        assert sv.password != ""
        passwd_check(sv.password, password)