File tree Expand file tree Collapse file tree
python/ql/test/experimental/library-tests/frameworks/invoke Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ | invoke_test.py:8:27:8:52 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
2+ | invoke_test.py:9:35:9:60 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
3+ | invoke_test.py:13:32:13:57 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
4+ | invoke_test.py:14:40:14:65 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
5+ | invoke_test.py:19:26:19:51 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
6+ | invoke_test.py:20:27:20:52 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
7+ | invoke_test.py:24:27:24:52 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
8+ | invoke_test.py:31:26:31:51 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
9+ | invoke_test.py:38:26:38:51 | Comment # $getCommand="cmd1; cmd2" | Missing result:getCommand="cmd1; cmd2" |
Original file line number Diff line number Diff line change 1+ import python
2+ import experimental.meta.ConceptsTest
Original file line number Diff line number Diff line change 1+ """tests for the 'invoke' package
2+
3+ see https://www.pyinvoke.org/
4+ """
5+
6+ import invoke
7+
8+ invoke .run ("cmd1; cmd2" ) # $getCommand="cmd1; cmd2"
9+ invoke .run (command = "cmd1; cmd2" ) # $getCommand="cmd1; cmd2"
10+
11+
12+ def with_sudo ():
13+ invoke .sudo ("cmd1; cmd2" ) # $getCommand="cmd1; cmd2"
14+ invoke .sudo (command = "cmd1; cmd2" ) # $getCommand="cmd1; cmd2"
15+
16+
17+ def manual_context ():
18+ c = invoke .Context ()
19+ c .run ("cmd1; cmd2" ) # $getCommand="cmd1; cmd2"
20+ c .sudo ("cmd1; cmd2" ) # $getCommand="cmd1; cmd2"
21+
22+ # invoke.Context is just an alias for invoke.context.Context
23+ c2 = invoke .context .Context ()
24+ c2 .run ("cmd1; cmd2" ) # $getCommand="cmd1; cmd2"
25+
26+
27+ manual_context ()
28+
29+
30+ def foo_helper (c ):
31+ c .run ("cmd1; cmd2" ) # $getCommand="cmd1; cmd2"
32+
33+
34+ # for use with the 'invoke' command-line tool
35+ @invoke .task
36+ def foo (c ):
37+ # 'c' is a invoke.context.Context
38+ c .run ("cmd1; cmd2" ) # $getCommand="cmd1; cmd2"
39+ foo_helper (c )
You can’t perform that action at this time.
0 commit comments