Revert user settings changes after running Existing Python Install integration test. (#5551)

This commit is contained in:
Cory Rivera
2019-05-20 15:44:14 -07:00
committed by GitHub
parent 8b9bb2a8fc
commit 7a03da42ec

View File

@@ -45,9 +45,13 @@ describe('Notebook Extension Python Installation', function () {
it('Verify Python Installation', async function () {
should(installComplete).be.true('Python setup did not complete.');
let jupyterPath = JupyterServerInstallation.getPythonInstallPath(jupyterController.jupyterInstallation.apiWrapper);
let apiWrapper = jupyterController.jupyterInstallation.apiWrapper;
let jupyterPath = JupyterServerInstallation.getPythonInstallPath(apiWrapper);
console.log(`Expected python path: '${pythonInstallDir}'; actual: '${jupyterPath}'`);
should(jupyterPath).be.equal(pythonInstallDir);
should(JupyterServerInstallation.isPythonInstalled(apiWrapper)).be.true();
should(JupyterServerInstallation.getExistingPythonSetting(apiWrapper)).be.false();
});
it('Use Existing Python Installation', async function () {
@@ -63,6 +67,17 @@ describe('Notebook Extension Python Installation', function () {
console.log('Start Existing Python Installation');
let existingPythonPath = path.join(pythonInstallDir, pythonBundleVersion);
await install.startInstallProcess(false, { installPath: existingPythonPath, existingPython: true });
let apiWrapper = install.apiWrapper;
should(JupyterServerInstallation.isPythonInstalled(apiWrapper)).be.true();
should(JupyterServerInstallation.getPythonInstallPath(apiWrapper)).be.equal(existingPythonPath);
should(JupyterServerInstallation.getExistingPythonSetting(apiWrapper)).be.true();
// Redo "new" install to restore original settings.
// The actual install should get skipped since it already exists.
await install.startInstallProcess(false, { installPath: pythonInstallDir, existingPython: false });
should(JupyterServerInstallation.isPythonInstalled(apiWrapper)).be.true();
should(JupyterServerInstallation.getPythonInstallPath(apiWrapper)).be.equal(pythonInstallDir);
should(JupyterServerInstallation.getExistingPythonSetting(apiWrapper)).be.false();
console.log('Existing Python Installation is done');
});
});