@@ -7,14 +7,16 @@ import * as sinon from 'sinon';
77import * as typemoq from 'typemoq' ;
88import { assert , use as chaiUse } from 'chai' ;
99import { ConfigurationTarget , Uri } from 'vscode' ;
10- import { IDisposableRegistry , IInterpreterPathService , IPathUtils } from '../../../client/common/types' ;
10+ import { IDisposableRegistry , IPathUtils } from '../../../client/common/types' ;
1111import * as commandApis from '../../../client/common/vscodeApis/commandApis' ;
12- import { IInterpreterQuickPick } from '../../../client/interpreter/configuration/types' ;
12+ import {
13+ IInterpreterQuickPick ,
14+ IPythonPathUpdaterServiceManager ,
15+ } from '../../../client/interpreter/configuration/types' ;
1316import { registerCreateEnvironmentFeatures } from '../../../client/pythonEnvironments/creation/createEnvApi' ;
1417import * as windowApis from '../../../client/common/vscodeApis/windowApis' ;
1518import { handleCreateEnvironmentCommand } from '../../../client/pythonEnvironments/creation/createEnvironment' ;
1619import { CreateEnvironmentProvider } from '../../../client/pythonEnvironments/creation/proposed.createEnvApis' ;
17- import { noop } from '../../core' ;
1820
1921chaiUse ( chaiAsPromised . default ) ;
2022
@@ -24,7 +26,7 @@ suite('Create Environment APIs', () => {
2426 let showInformationMessageStub : sinon . SinonStub ;
2527 const disposables : IDisposableRegistry = [ ] ;
2628 let interpreterQuickPick : typemoq . IMock < IInterpreterQuickPick > ;
27- let interpreterPathService : typemoq . IMock < IInterpreterPathService > ;
29+ let interpreterPathService : typemoq . IMock < IPythonPathUpdaterServiceManager > ;
2830 let pathUtils : typemoq . IMock < IPathUtils > ;
2931
3032 setup ( ( ) => {
@@ -33,7 +35,7 @@ suite('Create Environment APIs', () => {
3335
3436 registerCommandStub = sinon . stub ( commandApis , 'registerCommand' ) ;
3537 interpreterQuickPick = typemoq . Mock . ofType < IInterpreterQuickPick > ( ) ;
36- interpreterPathService = typemoq . Mock . ofType < IInterpreterPathService > ( ) ;
38+ interpreterPathService = typemoq . Mock . ofType < IPythonPathUpdaterServiceManager > ( ) ;
3739 pathUtils = typemoq . Mock . ofType < IPathUtils > ( ) ;
3840
3941 registerCommandStub . callsFake ( ( _command : string , _callback : ( ...args : any [ ] ) => any ) => ( {
@@ -49,11 +51,6 @@ suite('Create Environment APIs', () => {
4951 interpreterQuickPick . object ,
5052 interpreterPathService . object ,
5153 pathUtils . object ,
52- {
53- getRecommededEnvironment : ( ) => Promise . resolve ( undefined ) ,
54- registerEnvApi : noop ,
55- trackUserSelectedEnvironment : noop ,
56- } ,
5754 ) ;
5855 } ) ;
5956 teardown ( ( ) => {
@@ -88,10 +85,11 @@ suite('Create Environment APIs', () => {
8885
8986 interpreterPathService
9087 . setup ( ( p ) =>
91- p . update (
92- typemoq . It . isAny ( ) ,
93- ConfigurationTarget . WorkspaceFolder ,
88+ p . updatePythonPath (
9489 typemoq . It . isValue ( '/path/to/env' ) ,
90+ ConfigurationTarget . WorkspaceFolder ,
91+ 'ui' ,
92+ typemoq . It . isAny ( ) ,
9593 ) ,
9694 )
9795 . returns ( ( ) => Promise . resolve ( ) )
0 commit comments