Skip to content

Commit

Permalink
Adjust PythonStartUp test for new setting value (#24165)
Browse files Browse the repository at this point in the history
Since setting name is changed:
#24153
Adjusting the test accordingly.
  • Loading branch information
anthonykim1 authored Sep 24, 2024
1 parent 14e134e commit d879a0d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/test/terminals/shellIntegration/pythonStartup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,39 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
});

test('Verify createDirectory is called when shell integration is enabled', async () => {
pythonConfig.setup((p) => p.get('REPL.enableShellIntegration')).returns(() => true);
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => true);

await registerPythonStartup(context.object);

sinon.assert.calledOnce(createDirectoryStub);
});

test('Verify createDirectory is not called when shell integration is disabled', async () => {
pythonConfig.setup((p) => p.get('REPL.enableShellIntegration')).returns(() => false);
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => false);

await registerPythonStartup(context.object);

sinon.assert.notCalled(createDirectoryStub);
});

test('Verify copy is called when shell integration is enabled', async () => {
pythonConfig.setup((p) => p.get('REPL.enableShellIntegration')).returns(() => true);
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => true);

await registerPythonStartup(context.object);

sinon.assert.calledOnce(copyStub);
});

test('Verify copy is not called when shell integration is disabled', async () => {
pythonConfig.setup((p) => p.get('REPL.enableShellIntegration')).returns(() => false);
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => false);

await registerPythonStartup(context.object);

sinon.assert.notCalled(copyStub);
});

test('PYTHONSTARTUP is set when enableShellIntegration setting is true', async () => {
pythonConfig.setup((p) => p.get('REPL.enableShellIntegration')).returns(() => true);
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => true);

await registerPythonStartup(context.object);

Expand All @@ -97,15 +97,15 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
});

test('environmentCollection should not remove PYTHONSTARTUP when enableShellIntegration setting is true', async () => {
pythonConfig.setup((p) => p.get('REPL.enableShellIntegration')).returns(() => true);
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => true);

await registerPythonStartup(context.object);

globalEnvironmentVariableCollection.verify((c) => c.delete('PYTHONSTARTUP'), TypeMoq.Times.never());
});

test('PYTHONSTARTUP is not set when enableShellIntegration setting is false', async () => {
pythonConfig.setup((p) => p.get('REPL.enableShellIntegration')).returns(() => false);
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => false);

await registerPythonStartup(context.object);

Expand All @@ -116,7 +116,7 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
});

test('PYTHONSTARTUP is deleted when enableShellIntegration setting is false', async () => {
pythonConfig.setup((p) => p.get('REPL.enableShellIntegration')).returns(() => false);
pythonConfig.setup((p) => p.get('terminal.shellIntegration.enabled')).returns(() => false);

await registerPythonStartup(context.object);

Expand Down

0 comments on commit d879a0d

Please sign in to comment.