Skip to content

Commit 34e0862

Browse files
Add default option
1 parent f81403f commit 34e0862

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

src/extension/debugger/configuration/providers/djangoLaunch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function buildDjangoLaunchDebugConfiguration(
4343
} else {
4444
const managePath = path.join(state?.folder?.uri.fsPath || '', 'manage.py');
4545
options.push({
46-
label: 'manage.py',
46+
label: 'Default',
4747
description: parseManagePyPath(state.folder, managePath),
4848
filePath: Uri.file(managePath),
4949
});

src/test/unittest/configuration/providers/djangoLaunch.unit.test.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ suite('Debugging - Configuration Provider Django', () => {
3434
teardown(() => {
3535
sinon.restore();
3636
});
37-
test('Show picker and send parsed managepy paths', async () => {
37+
test('Show picker and send parsed found managepy paths', async () => {
3838
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
3939
const state = { config: {}, folder };
4040
const managePath = Uri.parse(path.join(folder.uri.fsPath, 'manage.py'));
41+
console.log('Folder:', folder.uri.fsPath);
42+
console.log('managePath: ', managePath);
4143
getDjangoPathsStub.resolves([managePath]);
4244
pickDjangoPromptStub.resolves();
4345
await djangoLaunch.buildDjangoLaunchDebugConfiguration(multiStepInput.object, state);
@@ -56,6 +58,26 @@ suite('Debugging - Configuration Provider Django', () => {
5658
},
5759
];
5860

61+
expect(options).to.be.deep.equal(expectedOptions);
62+
});
63+
test('Show picker and send defauge managepy path', async () => {
64+
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
65+
const state = { config: {}, folder };
66+
const managePath = path.join(state?.folder?.uri.fsPath, 'manage.py');
67+
console.log('Folder:', folder.uri.fsPath);
68+
console.log('managePath: ', managePath);
69+
getDjangoPathsStub.resolves([]);
70+
pickDjangoPromptStub.resolves();
71+
await djangoLaunch.buildDjangoLaunchDebugConfiguration(multiStepInput.object, state);
72+
const options = pickDjangoPromptStub.getCall(0).args[3];
73+
const expectedOptions = [
74+
{
75+
label: 'Default',
76+
filePath: Uri.file(managePath),
77+
description: `${djangoProviderQuickPick.workspaceFolderToken}-manage.py`,
78+
},
79+
];
80+
5981
expect(options).to.be.deep.equal(expectedOptions);
6082
});
6183
});

src/test/unittest/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function run(): Promise<void> {
1515
const testsRoot = path.resolve(__dirname);
1616

1717
return new Promise((c, e) => {
18-
glob('**/*.unit.test.js', { cwd: testsRoot }, (err: any, files: any[]) => {
18+
glob('**/providers/**/*.unit.test.js', { cwd: testsRoot }, (err: any, files: any[]) => {
1919
if (err) {
2020
return e(err);
2121
}

0 commit comments

Comments
 (0)