/ test / handler / test_bandit_handler.vader
test_bandit_handler.vader
 1  Before:
 2    runtime ale_linters/python/bandit.vim
 3  
 4  After:
 5    call ale#linter#Reset()
 6  
 7  Execute(The bandit handler for Python should parse input correctly):
 8    AssertEqual
 9    \ [
10    \   {
11    \     'bufnr': 0,
12    \     'lnum': 2,
13    \     'code': 'B404',
14    \     'type': 'I',
15    \     'text': 'Consider possible security implications associated with subprocess module.',
16    \   },
17    \   {
18    \     'bufnr': 0,
19    \     'lnum': 4,
20    \     'code': 'B305',
21    \     'type': 'W',
22    \     'text': 'Use of insecure cipher mode cryptography.hazmat.primitives.ciphers.modes.ECB.',
23    \   },
24    \   {
25    \     'bufnr': 0,
26    \     'lnum': 6,
27    \     'code': 'B609',
28    \     'type': 'E',
29    \     'text': 'Possible wildcard injection in call: subprocess.Popen',
30    \   },
31    \ ],
32    \ ale_linters#python#bandit#Handle(0, [
33    \   '[main]  INFO    profile include tests: None',
34    \   '[main]  INFO    profile exclude tests: None',
35    \   '[main]  INFO    cli include tests: None',
36    \   '[main]  INFO    cli exclude tests: None',
37    \   '[main]  INFO    running on Python 3.7.2',
38    \   '[node_visitor]  INFO    Unable to find qualified name for module: <stdin>',
39    \   '2:B404:LOW:Consider possible security implications associated with subprocess module.',
40    \   '4:B305:MEDIUM:Use of insecure cipher mode cryptography.hazmat.primitives.ciphers.modes.ECB.',
41    \   '6:B609:HIGH:Possible wildcard injection in call: subprocess.Popen',
42    \ ])