mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Python: Add tests for the 'invoke' package
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
| invoke_test.py:8:27:8:52 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
|
||||
| invoke_test.py:9:35:9:60 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
|
||||
| invoke_test.py:13:32:13:57 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
|
||||
| invoke_test.py:14:40:14:65 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
|
||||
| invoke_test.py:19:26:19:51 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
|
||||
| invoke_test.py:20:27:20:52 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
|
||||
| invoke_test.py:24:27:24:52 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
|
||||
| invoke_test.py:31:26:31:51 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
|
||||
| invoke_test.py:38:26:38:51 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
|
||||
@@ -0,0 +1,2 @@
|
||||
import python
|
||||
import experimental.meta.ConceptsTest
|
||||
@@ -0,0 +1,39 @@
|
||||
"""tests for the 'invoke' package
|
||||
|
||||
see https://www.pyinvoke.org/
|
||||
"""
|
||||
|
||||
import invoke
|
||||
|
||||
invoke.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
invoke.run(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
|
||||
|
||||
def with_sudo():
|
||||
invoke.sudo("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
invoke.sudo(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
|
||||
|
||||
def manual_context():
|
||||
c = invoke.Context()
|
||||
c.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c.sudo("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
|
||||
# invoke.Context is just an alias for invoke.context.Context
|
||||
c2 = invoke.context.Context()
|
||||
c2.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
|
||||
|
||||
manual_context()
|
||||
|
||||
|
||||
def foo_helper(c):
|
||||
c.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
|
||||
|
||||
# for use with the 'invoke' command-line tool
|
||||
@invoke.task
|
||||
def foo(c):
|
||||
# 'c' is a invoke.context.Context
|
||||
c.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
foo_helper(c)
|
||||
Reference in New Issue
Block a user