Skip to content

Commit

Permalink
fixed test to resolve settings before comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Nov 23, 2016
1 parent 7517a18 commit e2869f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/test/extension.common.configSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as assert from 'assert';
// as well as import your extension to test it
import * as vscode from 'vscode';
import { PythonSettings } from '../client/common/configSettings';
import { SystemVariables } from '../client/common/systemVariables';

const pythonSettings = PythonSettings.getInstance();

Expand All @@ -22,12 +23,16 @@ suite('Configuration Settings', () => {
});
if (!IS_TRAVIS) {
test('Check Values', done => {
const systemVariables: SystemVariables = new SystemVariables();
const pythonConfig = vscode.workspace.getConfiguration('python');
Object.keys(pythonSettings).forEach(key => {
const settingValue = pythonConfig.get(key, 'Not a config');
let settingValue = pythonConfig.get(key, 'Not a config');
if (settingValue === 'Not a config') {
return;
}
if (typeof settingValue === 'object' && settingValue !== null) {
settingValue = systemVariables.resolve(settingValue);
}
assert.deepEqual(settingValue, pythonSettings[key], `Setting ${key} not the same`);
});

Expand Down

0 comments on commit e2869f7

Please sign in to comment.