diff --git a/extensions/notebook/src/integrationTest/notebookIntegration.test.ts b/extensions/notebook/src/integrationTest/notebookIntegration.test.ts index 64d4d60fa2..1c8f605674 100644 --- a/extensions/notebook/src/integrationTest/notebookIntegration.test.ts +++ b/extensions/notebook/src/integrationTest/notebookIntegration.test.ts @@ -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'); }); });