5
5
6
6
import { assert , expect } from 'chai' ;
7
7
import * as path from 'path' ;
8
+ import * as sinon from 'sinon' ;
8
9
import { instance , mock , when } from 'ts-mockito' ;
9
10
import { buildApi } from '../client/api' ;
10
11
import { ConfigurationService } from '../client/common/configuration/service' ;
@@ -17,6 +18,7 @@ import { ServiceContainer } from '../client/ioc/container';
17
18
import { ServiceManager } from '../client/ioc/serviceManager' ;
18
19
import { IServiceContainer , IServiceManager } from '../client/ioc/types' ;
19
20
import { IDiscoveryAPI } from '../client/pythonEnvironments/base/locator' ;
21
+ import * as pythonDebugger from '../client/debugger/pythonDebugger' ;
20
22
21
23
suite ( 'Extension API' , ( ) => {
22
24
const debuggerPath = path . join ( EXTENSION_ROOT_DIR , 'python_files' , 'lib' , 'python' , 'debugpy' ) ;
@@ -29,6 +31,7 @@ suite('Extension API', () => {
29
31
let interpreterService : IInterpreterService ;
30
32
let discoverAPI : IDiscoveryAPI ;
31
33
let environmentVariablesProvider : IEnvironmentVariablesProvider ;
34
+ let getDebugpyPathStub : sinon . SinonStub ;
32
35
33
36
setup ( ( ) => {
34
37
serviceContainer = mock ( ServiceContainer ) ;
@@ -47,6 +50,12 @@ suite('Extension API', () => {
47
50
) ;
48
51
when ( serviceContainer . get < IInterpreterService > ( IInterpreterService ) ) . thenReturn ( instance ( interpreterService ) ) ;
49
52
when ( serviceContainer . get < IDisposableRegistry > ( IDisposableRegistry ) ) . thenReturn ( [ ] ) ;
53
+ getDebugpyPathStub = sinon . stub ( pythonDebugger , 'getDebugpyPath' ) ;
54
+ getDebugpyPathStub . resolves ( debuggerPath ) ;
55
+ } ) ;
56
+
57
+ teardown ( ( ) => {
58
+ sinon . restore ( ) ;
50
59
} ) ;
51
60
52
61
test ( 'Test debug launcher args (no-wait)' , async ( ) => {
0 commit comments