summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-06-17 20:39:07 +0100
committerGitHub <noreply@github.com>2018-06-17 20:39:07 +0100
commit24fe1953110455f7f3305db2a8e5abc2aa6821af (patch)
tree6813c12fe86cebd9c696e1537455e702c404ac8f /test
parent49a5d657eedbb1b3b0d8bb5697cee693378b5972 (diff)
parenteabf5d55d69131c8a3f5ba50d3c15b36cde1f9e6 (diff)
downloadale-24fe1953110455f7f3305db2a8e5abc2aa6821af.zip
Merge pull request #1650 from yasuhiroki/support-cfn-python-lint
Add linter for AWS CloudFormation template file
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_cfn_python_lint_handler.vader33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/handler/test_cfn_python_lint_handler.vader b/test/handler/test_cfn_python_lint_handler.vader
new file mode 100644
index 00000000..a053e84e
--- /dev/null
+++ b/test/handler/test_cfn_python_lint_handler.vader
@@ -0,0 +1,33 @@
+Before:
+ runtime! ale_linters/cloudformation/cfn_python_lint.vim
+ call ale#test#SetFilename('sample.template.yaml')
+
+After:
+ call ale#linter#Reset()
+
+Execute(The cfn_python_lint handler should parse items correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 96,
+ \ 'col': 7,
+ \ 'end_lnum': 96,
+ \ 'end_col': 15,
+ \ 'text': 'Property Resources/Sample/Properties/FromPort should be of type Integer',
+ \ 'code': 'E3012',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 97,
+ \ 'col': 7,
+ \ 'end_lnum': 97,
+ \ 'end_col': 15,
+ \ '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]))$"',
+ \ 'code': 'W2509',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#cloudformation#cfn_python_lint#Handle(bufnr(''), [
+ \ fnamemodify(tempname(), ':h') . '/sample.template.yaml:96:7:96:15: [E3012] Property Resources/Sample/Properties/FromPort should be of type Integer',
+ \ 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]))$"',
+ \ ])