Skip to content

Commit 25f6567

Browse files
author
Kartik Raj
committed
Correct activation manager tests
1 parent c1ed78f commit 25f6567

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/test/activation/activationManager.unit.test.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ suite('Activation Manager', () => {
558558
.setup((a) => a.getAutoSelectedInterpreter(resource))
559559
.returns(() => interpreter as any)
560560
.verifiable(typemoq.Times.once());
561-
when(interpreterPathService.get(resource)).thenReturn('python');
561+
when(interpreterPathService.get(resource)).thenReturn(setting);
562562
when(
563563
interpreterSecurityService.evaluateAndRecordInterpreterSafety(interpreter as any, resource)
564564
).thenResolve();
@@ -588,20 +588,12 @@ suite('Activation Manager', () => {
588588
});
589589

590590
test(`If in Deprecate PythonPath experiment, and setting is set, simply return`, async () => {
591-
const interpreter = undefined;
592591
when(experiments.inExperiment(DeprecatePythonPath.experiment)).thenReturn(true);
593592
when(workspaceService.getWorkspaceFolderIdentifier(resource)).thenReturn('1');
594-
autoSelection
595-
.setup((a) => a.getAutoSelectedInterpreter(resource))
596-
.returns(() => interpreter as any)
597-
.verifiable(typemoq.Times.never());
593+
autoSelection.setup((a) => a.getAutoSelectedInterpreter(resource)).verifiable(typemoq.Times.never());
598594
when(interpreterPathService.get(resource)).thenReturn('settingSetToSomePath');
599-
when(
600-
interpreterSecurityService.evaluateAndRecordInterpreterSafety(interpreter as any, resource)
601-
).thenResolve();
602595
await managerTest.evaluateAutoSelectedInterpreterSafety(resource);
603596
autoSelection.verifyAll();
604-
verify(interpreterSecurityService.evaluateAndRecordInterpreterSafety(interpreter as any, resource)).never();
605597
});
606598

607599
test(`If in Deprecate PythonPath experiment, if setting is set during evaluation, don't wait for the evaluation to finish to resolve method promise`, async () => {

0 commit comments

Comments
 (0)