@@ -13,7 +13,7 @@ import {
1313 NativeEnvManagerInfo ,
1414 NativePythonFinder ,
1515} from '../../client/pythonEnvironments/base/locators/common/nativePythonFinder' ;
16- import { Architecture , isWindows } from '../../client/common/utils/platform' ;
16+ import { Architecture , getPathEnvVariable , isWindows } from '../../client/common/utils/platform' ;
1717import { PythonEnvInfo , PythonEnvKind , PythonEnvType } from '../../client/pythonEnvironments/base/info' ;
1818import { NativePythonEnvironmentKind } from '../../client/pythonEnvironments/base/locators/common/nativePythonUtils' ;
1919import * as condaApi from '../../client/pythonEnvironments/common/environmentManagers/conda' ;
@@ -25,6 +25,8 @@ suite('Native Python API', () => {
2525 let api : IDiscoveryAPI ;
2626 let mockFinder : typemoq . IMock < NativePythonFinder > ;
2727 let setCondaBinaryStub : sinon . SinonStub ;
28+ let getCondaPathSettingStub : sinon . SinonStub ;
29+ let getCondaEnvDirsStub : sinon . SinonStub ;
2830 let setPyEnvBinaryStub : sinon . SinonStub ;
2931 let createPythonWatcherStub : sinon . SinonStub ;
3032 let mockWatcher : typemoq . IMock < pw . PythonWatcher > ;
@@ -136,6 +138,8 @@ suite('Native Python API', () => {
136138
137139 setup ( ( ) => {
138140 setCondaBinaryStub = sinon . stub ( condaApi , 'setCondaBinary' ) ;
141+ getCondaEnvDirsStub = sinon . stub ( condaApi , 'getCondaEnvDirs' ) ;
142+ getCondaPathSettingStub = sinon . stub ( condaApi , 'getCondaPathSetting' ) ;
139143 setPyEnvBinaryStub = sinon . stub ( pyenvApi , 'setPyEnvBinary' ) ;
140144 getWorkspaceFoldersStub = sinon . stub ( ws , 'getWorkspaceFolders' ) ;
141145 getWorkspaceFoldersStub . returns ( [ ] ) ;
@@ -294,9 +298,12 @@ suite('Native Python API', () => {
294298 } ) ;
295299
296300 test ( 'Setting conda binary' , async ( ) => {
301+ getCondaPathSettingStub . returns ( undefined ) ;
302+ getCondaEnvDirsStub . resolves ( undefined ) ;
303+ const condaFakeDir = getPathEnvVariable ( ) [ 0 ] ;
297304 const condaMgr : NativeEnvManagerInfo = {
298305 tool : 'Conda' ,
299- executable : '/usr/bin/ conda',
306+ executable : path . join ( condaFakeDir , ' conda') ,
300307 } ;
301308 mockFinder
302309 . setup ( ( f ) => f . refresh ( ) )
0 commit comments