@@ -9,7 +9,7 @@ import { IInterpreterPathService } from '../client/common/types';
9
9
import { IInterpreterService } from '../client/interpreter/contracts' ;
10
10
import { IServiceContainer } from '../client/ioc/types' ;
11
11
import { buildProposedApi } from '../client/proposedApi' ;
12
- import { IDiscoveryAPI } from '../client/pythonEnvironments/base/locator' ;
12
+ import { IDiscoveryAPI , ProgressNotificationEvent } from '../client/pythonEnvironments/base/locator' ;
13
13
import { PythonEnvironment } from '../client/pythonEnvironments/info' ;
14
14
import { PythonEnvKind , PythonEnvSource } from '../client/pythonEnvironments/base/info' ;
15
15
import { Architecture } from '../client/common/utils/platform' ;
@@ -21,6 +21,7 @@ suite('Proposed Extension API', () => {
21
21
let interpreterPathService : typemoq . IMock < IInterpreterPathService > ;
22
22
let interpreterService : typemoq . IMock < IInterpreterService > ;
23
23
let onDidExecutionEvent : Event < Uri | undefined > ;
24
+ let onRefreshProgress : Event < ProgressNotificationEvent > ;
24
25
25
26
let proposed : IProposedExtensionAPI ;
26
27
@@ -30,14 +31,21 @@ suite('Proposed Extension API', () => {
30
31
interpreterPathService = typemoq . Mock . ofType < IInterpreterPathService > ( undefined , typemoq . MockBehavior . Strict ) ;
31
32
interpreterService = typemoq . Mock . ofType < IInterpreterService > ( undefined , typemoq . MockBehavior . Strict ) ;
32
33
onDidExecutionEvent = typemoq . Mock . ofType < Event < Uri | undefined > > ( ) . object ;
34
+ onRefreshProgress = typemoq . Mock . ofType < Event < ProgressNotificationEvent > > ( ) . object ;
33
35
interpreterService . setup ( ( i ) => i . onDidChangeInterpreterConfiguration ) . returns ( ( ) => onDidExecutionEvent ) ;
34
36
35
37
serviceContainer . setup ( ( s ) => s . get ( IInterpreterPathService ) ) . returns ( ( ) => interpreterPathService . object ) ;
36
38
serviceContainer . setup ( ( s ) => s . get ( IInterpreterService ) ) . returns ( ( ) => interpreterService . object ) ;
37
39
40
+ discoverAPI . setup ( ( d ) => d . onProgress ) . returns ( ( ) => onRefreshProgress ) ;
41
+
38
42
proposed = buildProposedApi ( discoverAPI . object , serviceContainer . object ) ;
39
43
} ) ;
40
44
45
+ test ( 'Provide a callback for tracking refresh progress' , async ( ) => {
46
+ assert . deepEqual ( proposed . environment . onRefreshProgress , onRefreshProgress ) ;
47
+ } ) ;
48
+
41
49
test ( 'Provide a callback which is called when execution details changes' , async ( ) => {
42
50
assert . deepEqual ( onDidExecutionEvent , proposed . environment . onDidChangeExecutionDetails ) ;
43
51
} ) ;
0 commit comments