@@ -22,6 +22,7 @@ import {
22
22
workspaceFolderKeysForWhichTheCopyIsDone_Key ,
23
23
workspaceKeysForWhichTheCopyIsDone_Key
24
24
} from '../../client/common/interpreterPathService' ;
25
+ import { FileSystemPaths } from '../../client/common/platform/fs-paths' ;
25
26
import { InterpreterConfigurationScope , IPersistentState , IPersistentStateFactory } from '../../client/common/types' ;
26
27
import { createDeferred , sleep } from '../../client/common/utils/async' ;
27
28
@@ -32,6 +33,7 @@ suite('Interpreter Path Service', async () => {
32
33
const resource = Uri . parse ( 'a' ) ;
33
34
const resourceOutsideOfWorkspace = Uri . parse ( 'b' ) ;
34
35
const interpreterPath = 'path/to/interpreter' ;
36
+ const fs = FileSystemPaths . withDefaults ( ) ;
35
37
setup ( ( ) => {
36
38
const event = TypeMoq . Mock . ofType < Event < ConfigurationChangeEvent > > ( ) ;
37
39
workspaceService = TypeMoq . Mock . ofType < IWorkspaceService > ( ) ;
@@ -126,7 +128,7 @@ suite('Interpreter Path Service', async () => {
126
128
127
129
test ( 'If the one-off transfer to new storage has not happened yet for the workspace, do it and record the transfer' , async ( ) => {
128
130
const workspaceFileUri = Uri . parse ( 'path/to/workspaceFile' ) ;
129
- const expectedWorkspaceKey = 'PATH\\TO\\WORKSPACEFILE' ;
131
+ const expectedWorkspaceKey = fs . normCase ( workspaceFileUri . fsPath ) ;
130
132
const update = sinon . stub ( InterpreterPathService . prototype , 'update' ) ;
131
133
const persistentState = TypeMoq . Mock . ofType < IPersistentState < string [ ] > > ( ) ;
132
134
workspaceService . setup ( ( w ) => w . workspaceFile ) . returns ( ( ) => workspaceFileUri ) ;
@@ -148,7 +150,7 @@ suite('Interpreter Path Service', async () => {
148
150
149
151
test ( 'If the one-off transfer to new storage has already happened for the workspace, do not update and simply return' , async ( ) => {
150
152
const workspaceFileUri = Uri . parse ( 'path/to/workspaceFile' ) ;
151
- const expectedWorkspaceKey = 'PATH\\TO\\WORKSPACEFILE' ;
153
+ const expectedWorkspaceKey = fs . normCase ( workspaceFileUri . fsPath ) ;
152
154
const update = sinon . stub ( InterpreterPathService . prototype , 'update' ) ;
153
155
const persistentState = TypeMoq . Mock . ofType < IPersistentState < string [ ] > > ( ) ;
154
156
workspaceService . setup ( ( w ) => w . workspaceFile ) . returns ( ( ) => workspaceFileUri ) ;
@@ -330,7 +332,7 @@ suite('Interpreter Path Service', async () => {
330
332
331
333
test ( 'Workspace settings are correctly updated in case of multiroot folders' , async ( ) => {
332
334
const workspaceFileUri = Uri . parse ( 'path/to/workspaceFile' ) ;
333
- const expectedSettingKey = 'WORKSPACE_INTERPRETER_PATH_PATH\\TO\\WORKSPACEFILE' ;
335
+ const expectedSettingKey = `WORKSPACE_INTERPRETER_PATH_ ${ fs . normCase ( workspaceFileUri . fsPath ) } ` ;
334
336
const persistentState = TypeMoq . Mock . ofType < IPersistentState < string | undefined > > ( ) ;
335
337
workspaceService . setup ( ( w ) => w . getWorkspaceFolderIdentifier ( resource ) ) . returns ( ( ) => resource . fsPath ) ;
336
338
workspaceService . setup ( ( w ) => w . workspaceFile ) . returns ( ( ) => workspaceFileUri ) ;
@@ -507,7 +509,7 @@ suite('Interpreter Path Service', async () => {
507
509
508
510
test ( 'Inspecting settings returns as expected in case of multiroot folders' , async ( ) => {
509
511
const workspaceFileUri = Uri . parse ( 'path/to/workspaceFile' ) ;
510
- const expectedWorkspaceSettingKey = 'WORKSPACE_INTERPRETER_PATH_PATH\\TO\\WORKSPACEFILE' ;
512
+ const expectedWorkspaceSettingKey = `WORKSPACE_INTERPRETER_PATH_ ${ fs . normCase ( workspaceFileUri . fsPath ) } ` ;
511
513
const expectedWorkspaceFolderSettingKey = `WORKSPACE_FOLDER_INTERPRETER_PATH_${ resource . fsPath } ` ;
512
514
const workspaceConfig = TypeMoq . Mock . ofType < WorkspaceConfiguration > ( ) ;
513
515
// A workspace file is present in case of multiroot workspace folders
0 commit comments