@@ -4,6 +4,7 @@ import * as TypeMoq from 'typemoq';
4
4
import { Architecture , RegistryHive } from '../../client/common/platform/types' ;
5
5
import { IPersistentStateFactory } from '../../client/common/types' ;
6
6
import { IS_WINDOWS } from '../../client/debugger/Common/Utils' ;
7
+ import { IInterpreterHelper } from '../../client/interpreter/contracts' ;
7
8
import { WindowsRegistryService } from '../../client/interpreter/locators/services/windowsRegistryService' ;
8
9
import { IServiceContainer } from '../../client/ioc/types' ;
9
10
import { initialize , initializeTest } from '../initialize' ;
@@ -18,8 +19,12 @@ suite('Interpreters from Windows Registry', () => {
18
19
setup ( ( ) => {
19
20
serviceContainer = TypeMoq . Mock . ofType < IServiceContainer > ( ) ;
20
21
const stateFactory = TypeMoq . Mock . ofType < IPersistentStateFactory > ( ) ;
22
+ const interpreterHelper = TypeMoq . Mock . ofType < IInterpreterHelper > ( ) ;
21
23
serviceContainer . setup ( c => c . get ( TypeMoq . It . isValue ( IPersistentStateFactory ) ) ) . returns ( ( ) => stateFactory . object ) ;
24
+ serviceContainer . setup ( c => c . get ( TypeMoq . It . isValue ( IInterpreterHelper ) ) ) . returns ( ( ) => interpreterHelper . object ) ;
22
25
const state = new MockState ( undefined ) ;
26
+ // tslint:disable-next-line:no-empty no-any
27
+ interpreterHelper . setup ( h => h . getInterpreterInformation ( TypeMoq . It . isAny ( ) ) ) . returns ( ( ) => Promise . resolve ( { } as any ) ) ;
23
28
stateFactory . setup ( s => s . createGlobalPersistentState ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) ) . returns ( ( ) => state ) ;
24
29
return initializeTest ( ) ;
25
30
} ) ;
@@ -182,7 +187,7 @@ suite('Interpreters from Windows Registry', () => {
182
187
{ key : '\\Software\\Python' , hive : RegistryHive . HKLM , arch : Architecture . x86 , values : [ 'A' ] } ,
183
188
{ key : '\\Software\\Python\\Company A' , hive : RegistryHive . HKLM , arch : Architecture . x86 , values : [ 'Another Tag' ] }
184
189
] ;
185
- const registryValues : { key : string , hive : RegistryHive , arch ?: Architecture , value : string , name ?: string } [ ] = [
190
+ const registryValues : { key : string ; hive : RegistryHive ; arch ?: Architecture ; value : string ; name ?: string } [ ] = [
186
191
{ key : '\\Software\\Python\\Company One' , hive : RegistryHive . HKCU , arch : Architecture . x86 , value : 'Display Name for Company One' , name : 'DisplayName' } ,
187
192
{ key : '\\Software\\Python\\Company One\\Tag1\\InstallPath' , hive : RegistryHive . HKCU , arch : Architecture . x86 , value : path . join ( environmentsPath , 'conda' , 'envs' , 'numpy' ) } ,
188
193
{ key : '\\Software\\Python\\Company One\\Tag1\\InstallPath' , hive : RegistryHive . HKCU , arch : Architecture . x86 , value : path . join ( environmentsPath , 'conda' , 'envs' , 'numpy' , 'python.exe' ) , name : 'ExecutablePath' } ,
@@ -241,7 +246,7 @@ suite('Interpreters from Windows Registry', () => {
241
246
{ key : '\\Software\\Python' , hive : RegistryHive . HKLM , arch : Architecture . x86 , values : [ 'A' ] } ,
242
247
{ key : '\\Software\\Python\\Company A' , hive : RegistryHive . HKLM , arch : Architecture . x86 , values : [ 'Another Tag' ] }
243
248
] ;
244
- const registryValues : { key : string , hive : RegistryHive , arch ?: Architecture , value : string , name ?: string } [ ] = [
249
+ const registryValues : { key : string ; hive : RegistryHive ; arch ?: Architecture ; value : string ; name ?: string } [ ] = [
245
250
{ key : '\\Software\\Python\\Company One' , hive : RegistryHive . HKCU , arch : Architecture . x86 , value : 'Display Name for Company One' , name : 'DisplayName' } ,
246
251
{ key : '\\Software\\Python\\Company One\\Tag1\\InstallPath' , hive : RegistryHive . HKCU , arch : Architecture . x86 , value : path . join ( environmentsPath , 'conda' , 'envs' , 'numpy' ) } ,
247
252
{ key : '\\Software\\Python\\Company One\\Tag1\\InstallPath' , hive : RegistryHive . HKCU , arch : Architecture . x86 , value : path . join ( environmentsPath , 'conda' , 'envs' , 'numpy' , 'python.exe' ) , name : 'ExecutablePath' } ,
0 commit comments