Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust PythonStartUp test for new setting value #24165

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading