/ test / handler / test_cfn_python_lint_handler.vader
test_cfn_python_lint_handler.vader
 1  Before:
 2    runtime! ale_linters/cloudformation/cfn_python_lint.vim
 3    call ale#test#SetFilename('sample.template.yaml')
 4  
 5  After:
 6    call ale#linter#Reset()
 7  
 8  Execute(The cfn_python_lint handler should parse items correctly):
 9    AssertEqual
10    \ [
11    \   {
12    \     'lnum': '96',
13    \     'col': '7',
14    \     'end_lnum': '96',
15    \     'end_col': '15',
16    \     'text': 'Property Resources/Sample/Properties/FromPort should be of type Integer',
17    \     'code': 'E3012',
18    \     'type': 'E',
19    \   },
20    \   {
21    \     'lnum': '97',
22    \     'col': '7',
23    \     'end_lnum': '97',
24    \     'end_col': '15',
25    \     'text': 'AllowedPattern and/or AllowedValues for Parameter should be specified at Parameters/SampleIpAddress. Example for AllowedPattern "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$"',
26    \     'code': 'W2509',
27    \     'type': 'W',
28    \   },
29    \ ],
30    \ ale_linters#cloudformation#cfn_python_lint#Handle(bufnr(''), [
31    \ fnamemodify(tempname(), ':h') . '/sample.template.yaml:96:7:96:15:E3012:Property Resources/Sample/Properties/FromPort should be of type Integer',
32    \ fnamemodify(tempname(), ':h') . '/sample.template.yaml:97:7:97:15:W2509:AllowedPattern and/or AllowedValues for Parameter should be specified at Parameters/SampleIpAddress. Example for AllowedPattern "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$"',
33    \ ])