--- a/tests/test_incoming.py Sun Jun 26 09:26:16 2016 +0800
+++ b/tests/test_incoming.py Sun Jun 26 10:04:04 2016 +0800
def test_match_linter_output():
mlo = match_linter_output
+ usual_keys = ['cls', 'fileline', 'filename', 'linkend', 'linkstart']
errors, warnings, extra = mlo('hello.py:42:1: W123 clowntown ahoy')
- assert sorted(extra.keys()) == ['cls', 'fileline', 'filename']
+ assert sorted(extra.keys()) == usual_keys
assert extra['cls'] == 'warning'
assert extra['filename'] == 'hello.py'
assert extra['fileline'] == 42
+ assert extra['linkstart'] == 0
+ assert extra['linkend'] == 11
errors, warnings, extra = mlo('file with spaces:007:001: [error] oops!')
- assert sorted(extra.keys()) == ['cls', 'fileline', 'filename']
+ assert sorted(extra.keys()) == usual_keys
assert extra['cls'] == 'error'
assert extra['filename'] == 'file with spaces'
assert extra['fileline'] == 7
+ assert extra['linkstart'] == 0
+ assert extra['linkend'] == 20
errors, warnings, extra = mlo('requirements.txt:1:1: PIL is obsolete.')
- assert sorted(extra.keys()) == ['cls', 'fileline', 'filename']
+ assert sorted(extra.keys()) == usual_keys
assert extra['cls'] == 'warning'
assert extra['filename'] == 'requirements.txt'
assert extra['fileline'] == 1
+ assert extra['linkstart'] == 0
+ assert extra['linkend'] == 18
errors, warnings, extra = mlo('ham.lua:414:90: (E101) foo is not good')
- assert sorted(extra.keys()) == ['cls', 'fileline', 'filename']
+ assert sorted(extra.keys()) == usual_keys
assert extra['cls'] == 'error'
assert extra['filename'] == 'ham.lua'
assert extra['fileline'] == 414
+ assert extra['linkstart'] == 0
+ assert extra['linkend'] == 11
def test_parse_project_url():