8000 add getEnvFile Function to api · microsoft/vscode-python@346659d · GitHub
[go: up one dir, main page]

Skip to content

Commit 346659d

Browse files
add getEnvFile Function to api
1 parent cc70487 commit 346659d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/client/apiTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export interface IExtensionApi {
7070
*/
7171
execCommand: string[] | undefined;
7272
};
73+
getEnvFile(workspaceFolder?:Uri) : string;
7374
};
7475

7576
datascience: {

src/test/api.functional.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ suite('Extension API', () => {
7272
assert.deepEqual(execDetails, { execCommand: undefined });
7373
});
7474

75+
test('getEnvFile API returns expected object if interpreter is set', async () => {
76+
const resource = Uri.parse('a');
77+
when(configurationService.getSettings(resource)).thenReturn({ envFile: 'envFile' } as any);
78+
79+
const envFile = buildApi(
80+
Promise.resolve(),
81+
instance(serviceManager),
82+
instance(serviceContainer),
83+
).settings.getEnvFile(resource);
84+
85+
assert.equal(envFile, 'envFile');
86+
});
87+
7588
test('Provide a callback which is called when interpreter setting changes', async () => {
7689
const expectedEvent = Typemoq.Mock.ofType<Event<Uri | undefined>>().object;
7790
when(interpreterService.onDidChangeInterpreterConfiguration).thenReturn(expectedEvent);

0 commit comments

Comments
 (0)
0