Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export async function buildDjangoLaunchDebugConfiguration(
program: program || defaultProgram,
args: ['runserver'],
django: true,
autoStartBrowser: false,
};
if (!program) {
const selectedProgram = await input.showInputBox({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export async function buildFlaskLaunchDebugConfiguration(
},
args: ['run', '--no-debugger', '--no-reload'],
jinja: true,
autoStartBrowser: false,
};

if (!application) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ suite('Debugging - Configuration Provider Django', () => {
program: 'hello',
args: ['runserver'],
django: true,
autoStartBrowser: false,
};

expect(state.config).to.be.deep.equal(config);
Expand All @@ -129,6 +130,7 @@ suite('Debugging - Configuration Provider Django', () => {
program: defaultProgram,
args: ['runserver'],
django: true,
autoStartBrowser: false,
};

expect(state.config).to.be.deep.equal(config);
Expand Down
24 changes: 24 additions & 0 deletions src/test/unittest/configuration/providers/flaskLaunch.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,28 @@ suite('Debugging - Configuration Provider Flask', () => {

expect(file).to.be.equal('app.py');
});
test('Launch JSON with valid python path', async () => {
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
const state = { config: {}, folder };

await flaskLaunch.buildFlaskLaunchDebugConfiguration(instance(input), state);

const config = {
name: DebugConfigStrings.flask.snippet.name,
type: DebuggerTypeName,
request: 'launch',
module: 'flask',
env: {
FLASK_APP: 'app.py',
FLASK_DEBUG: '1',
},
args: ['run', '--no-debugger', '--no-reload'],
jinja: true,
autoStartBrowser: false,
};

expect(state.config).to.be.deep.equal(config);
});
test('Launch JSON with selected app path', async () => {
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
const state = { config: {}, folder };
Expand All @@ -60,6 +82,7 @@ suite('Debugging - Configuration Provider Flask', () => {
},
args: ['run', '--no-debugger', '--no-reload'],
jinja: true,
autoStartBrowser: false,
};

expect(state.config).to.be.deep.equal(config);
Expand All @@ -82,6 +105,7 @@ suite('Debugging - Configuration Provider Flask', () => {
},
args: ['run', '--no-debugger', '--no-reload'],
jinja: true,
autoStartBrowser: false,
};

expect(state.config).to.be.deep.equal(config);
Expand Down