Skip to content

Commit 964528a

Browse files
committed
another
1 parent a081af8 commit 964528a

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/test/managers/builtin/helpers.shouldUseUv.unit.test.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ import * as helpers from '../../../managers/builtin/helpers';
77
import { shouldUseUv } from '../../../managers/builtin/helpers';
88
import * as uvEnvironments from '../../../managers/builtin/uvEnvironments';
99

10+
interface MockWorkspaceConfig {
11+
get: sinon.SinonStub;
12+
inspect: sinon.SinonStub;
13+
update: sinon.SinonStub;
14+
}
15+
1016
suite('Helpers - shouldUseUv', () => {
11-
let getConfigurationStub: sinon.SinonStub;
12-
let mockConfig: { get: sinon.SinonStub };
17+
let mockGetConfiguration: sinon.SinonStub;
18+
let mockConfig: MockWorkspaceConfig;
1319
let mockLog: LogOutputChannel;
1420
let getWorkspacePersistentStateStub: sinon.SinonStub;
1521
let mockPersistentState: { get: sinon.SinonStub; set: sinon.SinonStub; clear: sinon.SinonStub };
@@ -20,11 +26,13 @@ suite('Helpers - shouldUseUv', () => {
2026
// Reset UV installation cache before each test to ensure clean state
2127
helpers.resetUvInstallationCache();
2228

23-
getConfigurationStub = sinon.stub(workspaceApis, 'getConfiguration');
29+
mockGetConfiguration = sinon.stub(workspaceApis, 'getConfiguration');
2430
mockConfig = {
2531
get: sinon.stub(),
32+
inspect: sinon.stub(),
33+
update: sinon.stub(),
2634
};
27-
getConfigurationStub.withArgs('python-envs').returns(mockConfig);
35+
mockGetConfiguration.withArgs('python-envs').returns(mockConfig);
2836

2937
// Mock persistent state
3038
getWorkspacePersistentStateStub = sinon.stub(persistentState, 'getWorkspacePersistentState');
@@ -67,6 +75,7 @@ suite('Helpers - shouldUseUv', () => {
6775
test('should return true when alwaysUseUv is true and UV is installed', async () => {
6876
// Mock - alwaysUseUv is true and UV is installed
6977
mockConfig.get.withArgs('alwaysUseUv', true).returns(true);
78+
mockConfig.get.withArgs('alwaysUseUv').returns(true);
7079
isUvInstalledStub.resolves(true);
7180
getUvEnvironmentsStub.resolves([]);
7281

0 commit comments

Comments
 (0)