@@ -29,7 +29,6 @@ import { PythonEnvCollectionChangedEvent } from '../client/pythonEnvironments/ba
2929import { normCasePath } from '../client/common/platform/fs-paths' ;
3030import {
3131 ActiveEnvironmentPathChangeEvent ,
32- EnvironmentPath ,
3332 EnvironmentsChangeEvent ,
3433 ProposedExtensionAPI ,
3534} from '../client/proposedApiTypes' ;
@@ -76,7 +75,7 @@ suite('Proposed Extension API', () => {
7675
7776 test ( 'Provide an event to track when active environment details change' , async ( ) => {
7877 const events : ActiveEnvironmentPathChangeEvent [ ] = [ ] ;
79- proposed . environment . onDidChangeActiveEnvironmentPath ( ( e ) => {
78+ proposed . environments . onDidChangeActiveEnvironmentPath ( ( e ) => {
8079 events . push ( e ) ;
8180 } ) ;
8281 reportActiveInterpreterChanged ( { path : 'path/to/environment' , resource : undefined } ) ;
@@ -91,25 +90,23 @@ suite('Proposed Extension API', () => {
9190 configService
9291 . setup ( ( c ) => c . getSettings ( undefined ) )
9392 . returns ( ( ) => ( ( { pythonPath } as unknown ) as IPythonSettings ) ) ;
94- const actual = proposed . environment . getActiveEnvironmentPath ( ) ;
95- assert . deepEqual ( actual , ( {
93+ const actual = proposed . environments . getActiveEnvironmentPath ( ) ;
94+ assert . deepEqual ( actual , {
9695 id : normCasePath ( pythonPath ) ,
9796 path : pythonPath ,
98- pathType : 'interpreterPath' ,
99- } as unknown ) as EnvironmentPath ) ;
97+ } ) ;
10098 } ) ;
10199
102100 test ( 'getActiveEnvironmentPath: default python' , ( ) => {
103101 const pythonPath = 'python' ;
104102 configService
105103 . setup ( ( c ) => c . getSettings ( undefined ) )
106104 . returns ( ( ) => ( ( { pythonPath } as unknown ) as IPythonSettings ) ) ;
107- const actual = proposed . environment . getActiveEnvironmentPath ( ) ;
108- assert . deepEqual ( actual , ( {
105+ const actual = proposed . environments . getActiveEnvironmentPath ( ) ;
106+ assert . deepEqual ( actual , {
109107 id : 'DEFAULT_PYTHON' ,
110108 path : pythonPath ,
111- pathType : 'interpreterPath' ,
112- } as unknown ) as EnvironmentPath ) ;
109+ } ) ;
113110 } ) ;
114111
115112 test ( 'getActiveEnvironmentPath: With resource' , ( ) => {
@@ -118,19 +115,18 @@ suite('Proposed Extension API', () => {
118115 configService
119116 . setup ( ( c ) => c . getSettings ( resource ) )
120117 . returns ( ( ) => ( ( { pythonPath } as unknown ) as IPythonSettings ) ) ;
121- const actual = proposed . environment . getActiveEnvironmentPath ( resource ) ;
122- assert . deepEqual ( actual , ( {
118+ const actual = proposed . environments . getActiveEnvironmentPath ( resource ) ;
119+ assert . deepEqual ( actual , {
123120 id : normCasePath ( pythonPath ) ,
124121 path : pythonPath ,
125- pathType : 'interpreterPath' ,
126- } as unknown ) as EnvironmentPath ) ;
122+ } ) ;
127123 } ) ;
128124
129125 test ( 'resolveEnvironment: invalid environment (when passed as string)' , async ( ) => {
130126 const pythonPath = 'this/is/a/test/path' ;
131127 discoverAPI . setup ( ( p ) => p . resolveEnv ( pythonPath ) ) . returns ( ( ) => Promise . resolve ( undefined ) ) ;
132128
133- const actual = await proposed . environment . resolveEnvironment ( pythonPath ) ;
129+ const actual = await proposed . environments . resolveEnvironment ( pythonPath ) ;
134130 expect ( actual ) . to . be . equal ( undefined ) ;
135131 } ) ;
136132
@@ -150,7 +146,7 @@ suite('Proposed Extension API', () => {
150146 } ) ;
151147 discoverAPI . setup ( ( p ) => p . resolveEnv ( pythonPath ) ) . returns ( ( ) => Promise . resolve ( env ) ) ;
152148
153- const actual = await proposed . environment . resolveEnvironment ( pythonPath ) ;
149+ const actual = await proposed . environments . resolveEnvironment ( pythonPath ) ;
154150 assert . deepEqual ( ( actual as EnvironmentReference ) . internal , convertCompleteEnvInfo ( env ) ) ;
155151 } ) ;
156152
@@ -176,13 +172,13 @@ suite('Proposed Extension API', () => {
176172 } ) ;
177173 discoverAPI . setup ( ( p ) => p . resolveEnv ( pythonPath ) ) . returns ( ( ) => Promise . resolve ( env ) ) ;
178174
179- const actual = await proposed . environment . resolveEnvironment ( convertCompleteEnvInfo ( partialEnv ) ) ;
175+ const actual = await proposed . environments . resolveEnvironment ( convertCompleteEnvInfo ( partialEnv ) ) ;
180176 assert . deepEqual ( ( actual as EnvironmentReference ) . internal , convertCompleteEnvInfo ( env ) ) ;
181177 } ) ;
182178
183179 test ( 'environments: no pythons found' , ( ) => {
184180 discoverAPI . setup ( ( d ) => d . getEnvs ( ) ) . returns ( ( ) => [ ] ) ;
185- const actual = proposed . environment . all ;
181+ const actual = proposed . environments . known ;
186182 expect ( actual ) . to . be . deep . equal ( [ ] ) ;
187183 } ) ;
188184
@@ -232,7 +228,7 @@ suite('Proposed Extension API', () => {
232228 } ,
233229 ] ;
234230 discoverAPI . setup ( ( d ) => d . getEnvs ( ) ) . returns ( ( ) => envs ) ;
235- const actual = proposed . environment . all ;
231+ const actual = proposed . environments . known ;
236232 const actualEnvs = actual ?. map ( ( a ) => ( a as EnvironmentReference ) . internal ) ;
237233 assert . deepEqual (
238234 actualEnvs ?. sort ( ( a , b ) => a . id . localeCompare ( b . id ) ) ,
@@ -244,7 +240,7 @@ suite('Proposed Extension API', () => {
244240 let events : EnvironmentsChangeEvent [ ] = [ ] ;
245241 let eventValues : EnvironmentsChangeEvent [ ] = [ ] ;
246242 let expectedEvents : EnvironmentsChangeEvent [ ] = [ ] ;
247- proposed . environment . onDidChangeEnvironments ( ( e ) => {
243+ proposed . environments . onDidChangeEnvironments ( ( e ) => {
248244 events . push ( e ) ;
249245 } ) ;
250246 const envs = [
@@ -336,7 +332,7 @@ suite('Proposed Extension API', () => {
336332 . returns ( ( ) => Promise . resolve ( ) )
337333 . verifiable ( typemoq . Times . once ( ) ) ;
338334
339- await proposed . environment . updateActiveEnvironmentPath ( 'this/is/a/test/python/path' ) ;
335+ await proposed . environments . updateActiveEnvironmentPath ( 'this/is/a/test/python/path' ) ;
340336
341337 interpreterPathService . verifyAll ( ) ;
342338 } ) ;
@@ -347,7 +343,7 @@ suite('Proposed Extension API', () => {
347343 . returns ( ( ) => Promise . resolve ( ) )
348344 . verifiable ( typemoq . Times . once ( ) ) ;
349345
350- await proposed . environment . updateActiveEnvironmentPath ( {
346+ await proposed . environments . updateActiveEnvironmentPath ( {
351347 id : normCasePath ( 'this/is/a/test/python/path' ) ,
352348 path : 'this/is/a/test/python/path' ,
353349 } ) ;
@@ -362,7 +358,7 @@ suite('Proposed Extension API', () => {
362358 . returns ( ( ) => Promise . resolve ( ) )
363359 . verifiable ( typemoq . Times . once ( ) ) ;
364360
365- await proposed . environment . updateActiveEnvironmentPath ( 'this/is/a/test/python/path' , uri ) ;
361+ await proposed . environments . updateActiveEnvironmentPath ( 'this/is/a/test/python/path' , uri ) ;
366362
367363 interpreterPathService . verifyAll ( ) ;
368364 } ) ;
@@ -379,7 +375,7 @@ suite('Proposed Extension API', () => {
379375 index : 0 ,
380376 } ;
381377
382- await proposed . environment . updateActiveEnvironmentPath ( 'this/is/a/test/python/path' , workspace ) ;
378+ await proposed . environments . updateActiveEnvironmentPath ( 'this/is/a/test/python/path' , workspace ) ;
383379
384380 interpreterPathService . verifyAll ( ) ;
385381 } ) ;
@@ -390,7 +386,7 @@ suite('Proposed Extension API', () => {
390386 . returns ( ( ) => Promise . resolve ( ) )
391387 . verifiable ( typemoq . Times . once ( ) ) ;
392388
393- await proposed . environment . refreshEnvironments ( ) ;
389+ await proposed . environments . refreshEnvironments ( ) ;
394390
395391 discoverAPI . verifyAll ( ) ;
396392 } ) ;
@@ -401,7 +397,7 @@ suite('Proposed Extension API', () => {
401397 . returns ( ( ) => Promise . resolve ( ) )
402398 . verifiable ( typemoq . Times . once ( ) ) ;
403399
404- await proposed . environment . refreshEnvironments ( { forceRefresh : true } ) ;
400+ await proposed . environments . refreshEnvironments ( { forceRefresh : true } ) ;
405401
406402 discoverAPI . verifyAll ( ) ;
407403 } ) ;
0 commit comments