@@ -12,6 +12,7 @@ import { Observable } from 'rxjs/Observable';
1212import * as sinon from 'sinon' ;
1313import { anything , instance , mock , reset , verify , when } from 'ts-mockito' ;
1414import { MessageConnection } from 'vscode-jsonrpc' ;
15+ import { IPlatformService } from '../../../client/common/platform/types' ;
1516import { ProcessLogger } from '../../../client/common/process/logger' ;
1617import { PythonDaemonExecutionService } from '../../../client/common/process/pythonDaemon' ;
1718import { PythonDaemonExecutionServicePool } from '../../../client/common/process/pythonDaemonPool' ;
@@ -34,11 +35,13 @@ suite('Daemon - Python Daemon Pool', () => {
3435 // tslint:disable-next-line: no-any use-default-type-parameter
3536 let listenStub : sinon . SinonStub < any [ ] , any > ;
3637 let pythonExecService : IPythonExecutionService ;
38+ let platformService : IPlatformService ;
3739 let logger : IProcessLogger ;
3840 let clock : fakeTimers . InstalledClock ;
3941 setup ( ( ) => {
4042 logger = instance ( mock ( ProcessLogger ) ) ;
4143 pythonExecService = mock < IPythonExecutionService > ( ) ;
44+ platformService = mock < IPlatformService > ( ) ;
4245 ( instance ( pythonExecService ) as any ) . then = undefined ;
4346 sendRequestStub = sinon . stub ( ) ;
4447 listenStub = sinon . stub ( ) ;
@@ -83,7 +86,14 @@ suite('Daemon - Python Daemon Pool', () => {
8386 }
8487 test ( 'Create daemons when initializing' , async ( ) => {
8588 // Create and initialize the pool.
86- const pool = new DaemonPool ( logger , [ ] , { pythonPath : 'py.exe' } , instance ( pythonExecService ) , undefined ) ;
89+ const pool = new DaemonPool (
90+ logger ,
91+ [ ] ,
92+ { pythonPath : 'py.exe' } ,
93+ instance ( pythonExecService ) ,
94+ instance ( platformService ) ,
95+ undefined
96+ ) ;
8797 await setupDaemon ( pool ) ;
8898
8999 // 2 = 2 for standard daemon + 1 observable daemon.
@@ -97,6 +107,7 @@ suite('Daemon - Python Daemon Pool', () => {
97107 [ ] ,
98108 { daemonCount : 5 , observableDaemonCount : 3 , pythonPath : 'py.exe' } ,
99109 instance ( pythonExecService ) ,
110+ instance ( platformService ) ,
100111 undefined
101112 ) ;
102113 await setupDaemon ( pool ) ;
@@ -115,6 +126,7 @@ suite('Daemon - Python Daemon Pool', () => {
115126 [ ] ,
116127 { daemonCount : 5 , observableDaemonCount : 3 , pythonPath : 'py.exe' } ,
117128 instance ( pythonExecService ) ,
129+ instance ( platformService ) ,
118130 undefined
119131 ) ;
120132 const promise = setupDaemon ( pool ) ;
@@ -143,6 +155,7 @@ suite('Daemon - Python Daemon Pool', () => {
143155 [ ] ,
144156 { daemonCount : 1 , observableDaemonCount : 1 , pythonPath : 'py.exe' } ,
145157 instance ( pythonExecService ) ,
158+ instance ( platformService ) ,
146159 undefined
147160 ) ;
148161 await setupDaemon ( pool ) ;
@@ -194,6 +207,7 @@ suite('Daemon - Python Daemon Pool', () => {
194207 [ ] ,
195208 { daemonCount : 2 , observableDaemonCount : 1 , pythonPath : 'py.exe' } ,
196209 instance ( pythonExecService ) ,
210+ instance ( platformService ) ,
197211 undefined
198212 ) ;
199213
@@ -272,6 +286,7 @@ suite('Daemon - Python Daemon Pool', () => {
272286 [ ] ,
273287 { daemonCount : 1 , observableDaemonCount : 1 , pythonPath : 'py.exe' } ,
274288 instance ( pythonExecService ) ,
289+ instance ( platformService ) ,
275290 undefined
276291 ) ;
277292 await setupDaemon ( pool ) ;
0 commit comments