Skip to content

Commit 914d87d

Browse files
committed
🐛 fix windows test
1 parent b83a543 commit 914d87d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/test/interpreters/windowsRegistryService.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as TypeMoq from 'typemoq';
44
import { Architecture, RegistryHive } from '../../client/common/platform/types';
55
import { IPersistentStateFactory } from '../../client/common/types';
66
import { IS_WINDOWS } from '../../client/debugger/Common/Utils';
7+
import { IInterpreterHelper } from '../../client/interpreter/contracts';
78
import { WindowsRegistryService } from '../../client/interpreter/locators/services/windowsRegistryService';
89
import { IServiceContainer } from '../../client/ioc/types';
910
import { initialize, initializeTest } from '../initialize';
@@ -18,8 +19,12 @@ suite('Interpreters from Windows Registry', () => {
1819
setup(() => {
1920
serviceContainer = TypeMoq.Mock.ofType<IServiceContainer>();
2021
const stateFactory = TypeMoq.Mock.ofType<IPersistentStateFactory>();
22+
const interpreterHelper = TypeMoq.Mock.ofType<IInterpreterHelper>();
2123
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);
2225
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));
2328
stateFactory.setup(s => s.createGlobalPersistentState(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => state);
2429
return initializeTest();
2530
});
@@ -182,7 +187,7 @@ suite('Interpreters from Windows Registry', () => {
182187
{ key: '\\Software\\Python', hive: RegistryHive.HKLM, arch: Architecture.x86, values: ['A'] },
183188
{ key: '\\Software\\Python\\Company A', hive: RegistryHive.HKLM, arch: Architecture.x86, values: ['Another Tag'] }
184189
];
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 }[] = [
186191
{ key: '\\Software\\Python\\Company One', hive: RegistryHive.HKCU, arch: Architecture.x86, value: 'Display Name for Company One', name: 'DisplayName' },
187192
{ key: '\\Software\\Python\\Company One\\Tag1\\InstallPath', hive: RegistryHive.HKCU, arch: Architecture.x86, value: path.join(environmentsPath, 'conda', 'envs', 'numpy') },
188193
{ 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', () => {
241246
{ key: '\\Software\\Python', hive: RegistryHive.HKLM, arch: Architecture.x86, values: ['A'] },
242247
{ key: '\\Software\\Python\\Company A', hive: RegistryHive.HKLM, arch: Architecture.x86, values: ['Another Tag'] }
243248
];
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 }[] = [
245250
{ key: '\\Software\\Python\\Company One', hive: RegistryHive.HKCU, arch: Architecture.x86, value: 'Display Name for Company One', name: 'DisplayName' },
246251
{ key: '\\Software\\Python\\Company One\\Tag1\\InstallPath', hive: RegistryHive.HKCU, arch: Architecture.x86, value: path.join(environmentsPath, 'conda', 'envs', 'numpy') },
247252
{ 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

Comments
 (0)