@@ -13,15 +13,19 @@ import * as commandApis from '../../client/common/vscodeApis/commandApis';
1313import { InterpreterPathCommand } from '../../client/interpreter/interpreterPathCommand' ;
1414import { IInterpreterService } from '../../client/interpreter/contracts' ;
1515import { PythonEnvironment } from '../../client/pythonEnvironments/info' ;
16+ import * as workspaceApis from '../../client/common/vscodeApis/workspaceApis' ;
1617
1718suite ( '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 ( ( ) => {
@@ -43,7 +47,7 @@ suite('Interpreter Path Command', () => {
4347 } ) ;
4448
4549 test ( 'If `workspaceFolder` property exists in `args`, it is used to retrieve setting from config' , async ( ) => {
46- const args = { workspaceFolder : 'folderPath' } ;
50+ const args = { workspaceFolder : 'folderPath' , type : 'debugpy' } ;
4751 when ( interpreterService . getActiveInterpreter ( anything ( ) ) ) . thenCall ( ( arg ) => {
4852 assert . deepEqual ( arg , Uri . file ( 'folderPath' ) ) ;
4953
@@ -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