@@ -7,9 +7,15 @@ import * as helpers from '../../../managers/builtin/helpers';
77import { shouldUseUv } from '../../../managers/builtin/helpers' ;
88import * as uvEnvironments from '../../../managers/builtin/uvEnvironments' ;
99
10+ interface MockWorkspaceConfig {
11+ get : sinon . SinonStub ;
12+ inspect : sinon . SinonStub ;
13+ update : sinon . SinonStub ;
14+ }
15+
1016suite ( '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