Skip to content

Commit fc5e15e

Browse files
committed
correct mocking
1 parent e52c9fb commit fc5e15e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/interpreters/interpreterPathCommand.unit.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@ import * as commandApis from '../../client/common/vscodeApis/commandApis';
1313
import { InterpreterPathCommand } from '../../client/interpreter/interpreterPathCommand';
1414
import { IInterpreterService } from '../../client/interpreter/contracts';
1515
import { PythonEnvironment } from '../../client/pythonEnvironments/info';
16+
import * as workspaceApis from '../../client/common/vscodeApis/workspaceApis';
1617

1718
suite('Interpreter Path Command', () => {
1819
let interpreterService: IInterpreterService;
1920
let interpreterPathCommand: InterpreterPathCommand;
2021
let registerCommandStub: sinon.SinonStub;
22+
let getConfigurationStub: sinon.SinonStub;
23+
2124
setup(() => {
2225
interpreterService = mock<IInterpreterService>();
2326
registerCommandStub = sinon.stub(commandApis, 'registerCommand');
2427
interpreterPathCommand = new InterpreterPathCommand(instance(interpreterService), []);
28+
getConfigurationStub = sinon.stub(workspaceApis, 'getConfiguration');
2529
});
2630

2731
teardown(() => {
@@ -76,6 +80,10 @@ suite('Interpreter Path Command', () => {
7680
});
7781

7882
test('If neither of these exists, value of workspace folder is `undefined`', async () => {
83+
getConfigurationStub.withArgs('python').returns({
84+
get: sinon.stub().returns(false),
85+
});
86+
7987
const args = ['command'];
8088

8189
when(interpreterService.getActiveInterpreter(undefined)).thenReturn(

0 commit comments

Comments
 (0)