@@ -25,6 +25,8 @@ import { ITerminalAutoActivation } from '../../../client/terminals/types';
2525import { createPythonInterpreter } from '../../utils/interpreters' ;
2626import * as workspaceApis from '../../../client/common/vscodeApis/workspaceApis' ;
2727import * as platform from '../../../client/common/utils/platform' ;
28+ import { IInterpreterService } from '../../../client/interpreter/contracts' ;
29+ import { PythonEnvironment } from '../../../client/pythonEnvironments/info' ;
2830
2931suite ( 'Terminal Service' , ( ) => {
3032 let service : TerminalService ;
@@ -44,6 +46,7 @@ suite('Terminal Service', () => {
4446 let pythonConfig : TypeMoq . IMock < WorkspaceConfiguration > ;
4547 let editorConfig : TypeMoq . IMock < WorkspaceConfiguration > ;
4648 let isWindowsStub : sinon . SinonStub ;
49+ let interpreterService : TypeMoq . IMock < IInterpreterService > ;
4750
4851 setup ( ( ) => {
4952 terminal = TypeMoq . Mock . ofType < VSCodeTerminal > ( ) ;
@@ -87,6 +90,10 @@ suite('Terminal Service', () => {
8790 disposables = [ ] ;
8891
8992 mockServiceContainer = TypeMoq . Mock . ofType < IServiceContainer > ( ) ;
93+ interpreterService = TypeMoq . Mock . ofType < IInterpreterService > ( ) ;
94+ interpreterService
95+ . setup ( ( i ) => i . getActiveInterpreter ( TypeMoq . It . isAny ( ) ) )
96+ . returns ( ( ) => Promise . resolve ( ( { path : 'ps' } as unknown ) as PythonEnvironment ) ) ;
9097
9198 mockServiceContainer . setup ( ( c ) => c . get ( ITerminalManager ) ) . returns ( ( ) => terminalManager . object ) ;
9299 mockServiceContainer . setup ( ( c ) => c . get ( ITerminalHelper ) ) . returns ( ( ) => terminalHelper . object ) ;
@@ -95,6 +102,8 @@ suite('Terminal Service', () => {
95102 mockServiceContainer . setup ( ( c ) => c . get ( IWorkspaceService ) ) . returns ( ( ) => workspaceService . object ) ;
96103 mockServiceContainer . setup ( ( c ) => c . get ( ITerminalActivator ) ) . returns ( ( ) => terminalActivator . object ) ;
97104 mockServiceContainer . setup ( ( c ) => c . get ( ITerminalAutoActivation ) ) . returns ( ( ) => terminalAutoActivator . object ) ;
105+ mockServiceContainer . setup ( ( c ) => c . get ( IInterpreterService ) ) . returns ( ( ) => interpreterService . object ) ;
106+
98107 getConfigurationStub = sinon . stub ( workspaceApis , 'getConfiguration' ) ;
99108 isWindowsStub = sinon . stub ( platform , 'isWindows' ) ;
100109 pythonConfig = TypeMoq . Mock . ofType < WorkspaceConfiguration > ( ) ;
0 commit comments