Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix tests
  • Loading branch information
DonJayamanne committed Mar 29, 2018
commit b103a03dca4046dda172e9c284efe20cf9b09e20
14 changes: 7 additions & 7 deletions src/test/linters/lint.args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,32 @@ suite('Linting - Arguments', () => {
[Uri.file(path.join('users', 'development path to', 'one.py')), Uri.file(path.join('users', 'development', 'one.py'))].forEach(fileUri => {
test(`Flake8 (${fileUri.fsPath.indexOf(' ') > 0 ? 'with spaces' : 'without spaces'})`, async () => {
const linter = new Flake8(outputChannel.object, serviceContainer);
const expectedArgs = ['--format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s', fileUri.fsPath.fileToCommandArgument()];
const expectedArgs = ['--format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s', fileUri.fsPath];
await testLinter(linter, fileUri, expectedArgs);
});
test(`Pep8 (${fileUri.fsPath.indexOf(' ') > 0 ? 'with spaces' : 'without spaces'})`, async () => {
const linter = new Pep8(outputChannel.object, serviceContainer);
const expectedArgs = ['--format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s', fileUri.fsPath.fileToCommandArgument()];
const expectedArgs = ['--format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s', fileUri.fsPath];
await testLinter(linter, fileUri, expectedArgs);
});
test(`Prospector (${fileUri.fsPath.indexOf(' ') > 0 ? 'with spaces' : 'without spaces'})`, async () => {
const linter = new Prospector(outputChannel.object, serviceContainer);
const expectedArgs = ['--absolute-paths', '--output-format=json', fileUri.fsPath.fileToCommandArgument()];
const expectedArgs = ['--absolute-paths', '--output-format=json', fileUri.fsPath];
await testLinter(linter, fileUri, expectedArgs);
});
test(`Pylama (${fileUri.fsPath.indexOf(' ') > 0 ? 'with spaces' : 'without spaces'})`, async () => {
const linter = new PyLama(outputChannel.object, serviceContainer);
const expectedArgs = ['--format=parsable', fileUri.fsPath.fileToCommandArgument()];
const expectedArgs = ['--format=parsable', fileUri.fsPath];
await testLinter(linter, fileUri, expectedArgs);
});
test(`MyPy (${fileUri.fsPath.indexOf(' ') > 0 ? 'with spaces' : 'without spaces'})`, async () => {
const linter = new MyPy(outputChannel.object, serviceContainer);
const expectedArgs = [fileUri.fsPath.fileToCommandArgument()];
const expectedArgs = [fileUri.fsPath];
await testLinter(linter, fileUri, expectedArgs);
});
test(`Pydocstyle (${fileUri.fsPath.indexOf(' ') > 0 ? 'with spaces' : 'without spaces'})`, async () => {
const linter = new PyDocStyle(outputChannel.object, serviceContainer);
const expectedArgs = [fileUri.fsPath.fileToCommandArgument()];
const expectedArgs = [fileUri.fsPath];
await testLinter(linter, fileUri, expectedArgs);
});
test(`Pylint (${fileUri.fsPath.indexOf(' ') > 0 ? 'with spaces' : 'without spaces'})`, async () => {
Expand All @@ -144,7 +144,7 @@ suite('Linting - Arguments', () => {

let invoked = false;
(linter as any).run = (args, doc, token) => {
expect(args[args.length - 1]).to.equal(fileUri.fsPath.fileToCommandArgument());
expect(args[args.length - 1]).to.equal(fileUri.fsPath);
invoked = true;
return Promise.resolve([]);
};
Expand Down