]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/ale/test/handler/test_bandit_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_bandit_handler.vader
diff --git a/.vim/bundle/ale/test/handler/test_bandit_handler.vader b/.vim/bundle/ale/test/handler/test_bandit_handler.vader
new file mode 100644 (file)
index 0000000..a2793a4
--- /dev/null
@@ -0,0 +1,42 @@
+Before:
+  runtime ale_linters/python/bandit.vim
+
+After:
+  call ale#linter#Reset()
+
+Execute(The bandit handler for Python should parse input correctly):
+  AssertEqual
+  \ [
+  \   {
+  \     'bufnr': 0,
+  \     'lnum': 2,
+  \     'code': 'B404',
+  \     'type': 'I',
+  \     'text': 'Consider possible security implications associated with subprocess module.',
+  \   },
+  \   {
+  \     'bufnr': 0,
+  \     'lnum': 4,
+  \     'code': 'B305',
+  \     'type': 'W',
+  \     'text': 'Use of insecure cipher mode cryptography.hazmat.primitives.ciphers.modes.ECB.',
+  \   },
+  \   {
+  \     'bufnr': 0,
+  \     'lnum': 6,
+  \     'code': 'B609',
+  \     'type': 'E',
+  \     'text': 'Possible wildcard injection in call: subprocess.Popen',
+  \   },
+  \ ],
+  \ ale_linters#python#bandit#Handle(0, [
+  \   '[main]  INFO    profile include tests: None',
+  \   '[main]  INFO    profile exclude tests: None',
+  \   '[main]  INFO    cli include tests: None',
+  \   '[main]  INFO    cli exclude tests: None',
+  \   '[main]  INFO    running on Python 3.7.2',
+  \   '[node_visitor]  INFO    Unable to find qualified name for module: <stdin>',
+  \   '2:B404:LOW:Consider possible security implications associated with subprocess module.',
+  \   '4:B305:MEDIUM:Use of insecure cipher mode cryptography.hazmat.primitives.ciphers.modes.ECB.',
+  \   '6:B609:HIGH:Possible wildcard injection in call: subprocess.Popen',
+  \ ])