Skip to content

Commit e63c0d2

Browse files
fix tests
1 parent ff687e5 commit e63c0d2

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/test/unittest/adapter/factory.unit.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ suite('Debugging - Adapter Factory', () => {
3333
let showErrorMessageStub: sinon.SinonStub;
3434
let resolveEnvironmentStub: sinon.SinonStub;
3535
let getInterpretersStub: sinon.SinonStub;
36-
let getActiveEnvironmentPathStub: sinon.SinonStub;
36+
let getInterpreterDetailsStub: sinon.SinonStub;
3737
let hasInterpretersStub: sinon.SinonStub;
3838

3939
const nodeExecutable = undefined;
@@ -71,7 +71,7 @@ suite('Debugging - Adapter Factory', () => {
7171
showErrorMessageStub = sinon.stub(vscodeApi, 'showErrorMessage');
7272
resolveEnvironmentStub = sinon.stub(pythonApi, 'resolveEnvironment');
7373
getInterpretersStub = sinon.stub(pythonApi, 'getInterpreters');
74-
getActiveEnvironmentPathStub = sinon.stub(pythonApi, 'getActiveEnvironmentPath');
74+
getInterpreterDetailsStub = sinon.stub(pythonApi, 'getInterpreterDetails');
7575
hasInterpretersStub = sinon.stub(pythonApi, 'hasInterpreters');
7676

7777
when(
@@ -119,15 +119,15 @@ suite('Debugging - Adapter Factory', () => {
119119
test('Return the path of the active interpreter as the current python path, it exists and configuration.pythonPath is not defined', async () => {
120120
const session = createSession({});
121121
const debugExecutable = new DebugAdapterExecutable(pythonPath, [debugAdapterPath]);
122-
getActiveEnvironmentPathStub.resolves(interpreter.path);
122+
getInterpreterDetailsStub.resolves({ path: [interpreter.path] });
123123
resolveEnvironmentStub.resolves(interpreter);
124124
const descriptor = await factory.createDebugAdapterDescriptor(session, nodeExecutable);
125125

126126
assert.deepStrictEqual(descriptor, debugExecutable);
127127
});
128128

129129
test('Display a message if no python interpreter is set', async () => {
130-
getActiveEnvironmentPathStub.resolves(undefined);
130+
getInterpreterDetailsStub.resolves(undefined);
131131
const session = createSession({});
132132
const promise = factory.createDebugAdapterDescriptor(session, nodeExecutable);
133133

@@ -149,7 +149,7 @@ suite('Debugging - Adapter Factory', () => {
149149
version: new SemVer('3.6.12-test'),
150150
};
151151
when(state.value).thenReturn(false);
152-
getActiveEnvironmentPathStub.resolves(deprecatedInterpreter.path);
152+
getInterpreterDetailsStub.resolves({ path: [deprecatedInterpreter.path] });
153153
resolveEnvironmentStub.resolves(deprecatedInterpreter);
154154

155155
await factory.createDebugAdapterDescriptor(session, nodeExecutable);
@@ -195,7 +195,7 @@ suite('Debugging - Adapter Factory', () => {
195195
test('Return Debug Adapter executable if request is "attach", and listen is specified', async () => {
196196
const session = createSession({ request: 'attach', listen: { port: 5678, host: 'localhost' } });
197197
const debugExecutable = new DebugAdapterExecutable(pythonPath, [debugAdapterPath]);
198-
getActiveEnvironmentPathStub.resolves(interpreter.path);
198+
getInterpreterDetailsStub.resolves({ path: [interpreter.path] });
199199
resolveEnvironmentStub.resolves(interpreter);
200200
const descriptor = await factory.createDebugAdapterDescriptor(session, nodeExecutable);
201201

@@ -226,7 +226,7 @@ suite('Debugging - Adapter Factory', () => {
226226
EXTENSION_ROOT_DIR,
227227
]);
228228

229-
getActiveEnvironmentPathStub.resolves(interpreter.path);
229+
getInterpreterDetailsStub.resolves({ path: [interpreter.path] });
230230
resolveEnvironmentStub.withArgs(interpreter.path).resolves(interpreter);
231231

232232
const descriptor = await factory.createDebugAdapterDescriptor(session, nodeExecutable);
@@ -238,7 +238,7 @@ suite('Debugging - Adapter Factory', () => {
238238
const session = createSession({});
239239
const debugExecutable = new DebugAdapterExecutable(pythonPath, [debugAdapterPath]);
240240

241-
getActiveEnvironmentPathStub.resolves(interpreter.path);
241+
getInterpreterDetailsStub.resolves({ path: [interpreter.path] });
242242
resolveEnvironmentStub.withArgs(interpreter.path).resolves(interpreter);
243243

244244
const descriptor = await factory.createDebugAdapterDescriptor(session, nodeExecutable);
@@ -250,7 +250,7 @@ suite('Debugging - Adapter Factory', () => {
250250
const session = createSession({ logToFile: false });
251251
const debugExecutable = new DebugAdapterExecutable(pythonPath, [debugAdapterPath]);
252252

253-
getActiveEnvironmentPathStub.resolves(interpreter.path);
253+
getInterpreterDetailsStub.resolves({ path: [interpreter.path] });
254254
resolveEnvironmentStub.withArgs(interpreter.path).resolves(interpreter);
255255

256256
const descriptor = await factory.createDebugAdapterDescriptor(session, nodeExecutable);
@@ -260,7 +260,7 @@ suite('Debugging - Adapter Factory', () => {
260260

261261
test('Send attach to local process telemetry if attaching to a local process', async () => {
262262
const session = createSession({ request: 'attach', processId: 1234 });
263-
getActiveEnvironmentPathStub.resolves(interpreter.path);
263+
getInterpreterDetailsStub.resolves({ path: [interpreter.path] });
264264
resolveEnvironmentStub.withArgs(interpreter.path).resolves(interpreter);
265265

266266
await factory.createDebugAdapterDescriptor(session, nodeExecutable);
@@ -270,7 +270,7 @@ suite('Debugging - Adapter Factory', () => {
270270

271271
test("Don't send any telemetry if not attaching to a local process", async () => {
272272
const session = createSession({});
273-
getActiveEnvironmentPathStub.resolves(interpreter.path);
273+
getInterpreterDetailsStub.resolves({ path: [interpreter.path] });
274274
resolveEnvironmentStub.withArgs(interpreter.path).resolves(interpreter);
275275

276276
await factory.createDebugAdapterDescriptor(session, nodeExecutable);
@@ -282,7 +282,7 @@ suite('Debugging - Adapter Factory', () => {
282282
const customAdapterPath = 'custom/debug/adapter/path';
283283
const session = createSession({ debugAdapterPath: customAdapterPath });
284284
const debugExecutable = new DebugAdapterExecutable(pythonPath, [customAdapterPath]);
285-
getActiveEnvironmentPathStub.resolves(interpreter.path);
285+
getInterpreterDetailsStub.resolves({ path: [interpreter.path] });
286286
resolveEnvironmentStub.withArgs(interpreter.path).resolves(interpreter);
287287
const descriptor = await factory.createDebugAdapterDescriptor(session, nodeExecutable);
288288

@@ -310,7 +310,7 @@ suite('Debugging - Adapter Factory', () => {
310310
test('Do not use "python" to spawn the debug adapter', async () => {
311311
const session = createSession({ python: '/bin/custompy' });
312312
const debugExecutable = new DebugAdapterExecutable(pythonPath, [debugAdapterPath]);
313-
getActiveEnvironmentPathStub.resolves(interpreter.path);
313+
getInterpreterDetailsStub.resolves({ path: [interpreter.path] });
314314
resolveEnvironmentStub.withArgs(interpreter.path).resolves(interpreter);
315315
const descriptor = await factory.createDebugAdapterDescriptor(session, nodeExecutable);
316316

0 commit comments

Comments
 (0)