@@ -183,13 +183,17 @@ suite('Kernel Finder', () => {
183
183
argv : [ '<python path>' , '-m' , 'ipykernel_launcher' , '-f' , '{connection_file}' ]
184
184
} ;
185
185
186
+ platformService . reset ( ) ;
187
+ platformService . setup ( ( ps ) => ps . isWindows ) . returns ( ( ) => false ) ;
188
+ platformService . setup ( ( ps ) => ps . isMac ) . returns ( ( ) => true ) ;
189
+
186
190
workspaceService = mock < IWorkspaceService > ( ) ;
187
191
when ( workspaceService . getWorkspaceFolderIdentifier ( anything ( ) , resource . fsPath ) ) . thenReturn (
188
192
resource . fsPath
189
193
) ;
190
194
191
195
// Setup file system
192
- const activePath = 'active/ share/ jupyter/ kernels' ;
196
+ const activePath = path . join ( 'active' , ' share' , ' jupyter' , ' kernels') ;
193
197
const activePathA = path . join ( activePath , activeKernelA . name , 'kernel.json' ) ;
194
198
const activePathB = path . join ( activePath , activeKernelB . name , 'kernel.json' ) ;
195
199
fileSystem
@@ -206,9 +210,9 @@ suite('Kernel Finder', () => {
206
210
path . join ( activeKernelB . name , 'kernel.json' )
207
211
] )
208
212
) ;
209
- const interpreter0Path = 'Interpreter0/ share/ jupyter/ kernels' ;
213
+ const interpreter0Path = path . join ( 'Interpreter0' , ' share' , ' jupyter' , ' kernels') ;
210
214
const interpreter0FullPath = path . join ( interpreter0Path , interpreter0Kernel . name , 'kernel.json' ) ;
211
- const interpreter1Path = 'Interpreter1/ share/ jupyter/ kernels' ;
215
+ const interpreter1Path = path . join ( 'Interpreter1' , ' share' , ' jupyter' , ' kernels') ;
212
216
const interpreter1FullPath = path . join ( interpreter1Path , interpreter1Kernel . name , 'kernel.json' ) ;
213
217
fileSystem
214
218
. setup ( ( fs ) => fs . search ( typemoq . It . isAnyString ( ) , interpreter0Path ) )
@@ -217,12 +221,22 @@ suite('Kernel Finder', () => {
217
221
. setup ( ( fs ) => fs . search ( typemoq . It . isAnyString ( ) , interpreter1Path ) )
218
222
. returns ( ( ) => Promise . resolve ( [ path . join ( interpreter1Kernel . name , 'kernel.json' ) ] ) ) ;
219
223
220
- const globalPath = 'AppData/Roaming/ jupyter/ kernels';
224
+ const globalPath = path . join ( 'usr' , 'share' , ' jupyter' , ' kernels') ;
221
225
const globalFullPath = path . join ( globalPath , globalKernel . name , 'kernel.json' ) ;
222
226
fileSystem
223
227
. setup ( ( fs ) => fs . search ( typemoq . It . isAnyString ( ) , globalPath ) )
224
228
. returns ( ( ) => Promise . resolve ( [ path . join ( globalKernel . name , 'kernel.json' ) ] ) ) ;
225
229
230
+ // Empty global paths
231
+ const globalAPath = path . join ( 'usr' , 'local' , 'share' , 'jupyter' , 'kernels' ) ;
232
+ fileSystem
233
+ . setup ( ( fs ) => fs . search ( typemoq . It . isAnyString ( ) , globalAPath ) )
234
+ . returns ( ( ) => Promise . resolve ( [ ] ) ) ;
235
+ const globalBPath = path . join ( 'Library' , 'Jupyter' , 'kernels' ) ;
236
+ fileSystem
237
+ . setup ( ( fs ) => fs . search ( typemoq . It . isAnyString ( ) , globalBPath ) )
238
+ . returns ( ( ) => Promise . resolve ( [ ] ) ) ;
239
+
226
240
// Set the file system to return our kernelspec json
227
241
fileSystem
228
242
. setup ( ( fs ) => fs . readFile ( typemoq . It . isAnyString ( ) ) )
0 commit comments