mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 09:35:38 -05:00
Remove unnecessary OutputChannel reference from PythonPathLookup class. (#13970)
This commit is contained in:
@@ -13,16 +13,14 @@ import { PickPackagesPage } from '../../dialog/configurePython/pickPackagesPage'
|
||||
import { python3DisplayName, allKernelsName } from '../../common/constants';
|
||||
import { TestContext, createViewContext, TestButton } from '../common';
|
||||
import { EventEmitter } from 'vscode';
|
||||
import { MockOutputChannel } from '../common/stubs';
|
||||
import { PythonPathLookup } from '../../dialog/pythonPathLookup';
|
||||
|
||||
describe('Configure Python Wizard', function () {
|
||||
let testWizard: ConfigurePythonWizard;
|
||||
let viewContext: TestContext;
|
||||
let testInstallation: JupyterServerInstallation;
|
||||
let mockOutputChannel: TypeMoq.IMock<MockOutputChannel>;
|
||||
|
||||
beforeEach(() => {
|
||||
mockOutputChannel = TypeMoq.Mock.ofType(MockOutputChannel);
|
||||
let mockInstall = TypeMoq.Mock.ofType(JupyterServerInstallation);
|
||||
mockInstall.setup(i => i.getInstalledPipPackages(TypeMoq.It.isAnyString())).returns(() => Promise.resolve([]));
|
||||
mockInstall.setup(i => i.getRequiredPackagesForKernel(TypeMoq.It.isAnyString())).returns(() => [{ name: 'TestPkg', version: '1.0.0'}]);
|
||||
@@ -44,21 +42,21 @@ describe('Configure Python Wizard', function () {
|
||||
});
|
||||
|
||||
it('Start wizard test', async () => {
|
||||
let wizard = new ConfigurePythonWizard(testInstallation, mockOutputChannel.object);
|
||||
let wizard = new ConfigurePythonWizard(testInstallation);
|
||||
await wizard.start();
|
||||
await wizard.close();
|
||||
await should(wizard.setupComplete).be.resolved();
|
||||
});
|
||||
|
||||
it('Reject setup on cancel test', async () => {
|
||||
let wizard = new ConfigurePythonWizard(testInstallation, mockOutputChannel.object);
|
||||
let wizard = new ConfigurePythonWizard(testInstallation);
|
||||
await wizard.start(undefined, true);
|
||||
await wizard.close();
|
||||
await should(wizard.setupComplete).be.rejected();
|
||||
});
|
||||
|
||||
it('Error message test', async () => {
|
||||
let wizard = new ConfigurePythonWizard(testInstallation, mockOutputChannel.object);
|
||||
let wizard = new ConfigurePythonWizard(testInstallation);
|
||||
await wizard.start();
|
||||
|
||||
should(wizard.wizard.message).be.undefined();
|
||||
@@ -72,16 +70,21 @@ describe('Configure Python Wizard', function () {
|
||||
should(wizard.wizard.message).be.undefined();
|
||||
|
||||
await wizard.close();
|
||||
await should(wizard.setupComplete).be.resolved();
|
||||
});
|
||||
|
||||
it('Configure Path Page test', async () => {
|
||||
let testPythonLocation = '/not/a/real/path';
|
||||
let model = <ConfigurePythonModel>{
|
||||
useExistingPython: true,
|
||||
pythonPathsPromise: Promise.resolve([{
|
||||
let mockPathLookup = TypeMoq.Mock.ofType(PythonPathLookup);
|
||||
mockPathLookup.setup(p => p.getSuggestions()).returns(() =>
|
||||
Promise.resolve([{
|
||||
installDir: testPythonLocation,
|
||||
version: '4000'
|
||||
}])
|
||||
);
|
||||
let model = <ConfigurePythonModel>{
|
||||
useExistingPython: true,
|
||||
pythonPathLookup: mockPathLookup.object
|
||||
};
|
||||
|
||||
let page = azdata.window.createWizardPage('Page 1');
|
||||
|
||||
Reference in New Issue
Block a user