File tree Expand file tree Collapse file tree 6 files changed +132
-5
lines changed
Expand file tree Collapse file tree 6 files changed +132
-5
lines changed Original file line number Diff line number Diff line change 55from dotflow import action
66
77
8- def callback (* args , ** kwargs ):
9- print (args , ** kwargs )
10-
11-
128@action
139def simple_step ():
1410 return "ok"
1511
1612
13+ def main ():
14+ """Output
15+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 56a908c5-c9f2-4ebf-a00a-895e49bd189b - 0 - Not started
16+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 56a908c5-c9f2-4ebf-a00a-895e49bd189b - 0 - In progress
17+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 56a908c5-c9f2-4ebf-a00a-895e49bd189b - 0 - Completed
18+ """
19+ system ("dotflow start --step examples.cli.simple_step" )
20+
21+
1722if __name__ == "__main__" :
18- system ( "dotflow task start --step examples.cli.simple_step" )
23+ main ( )
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ from os import system
4+
5+ from dotflow import action
6+
7+
8+ def callback (* args , ** kwargs ):
9+ print (args , kwargs )
10+
11+
12+ @action
13+ def simple_step ():
14+ return "ok"
15+
16+
17+ def main ():
18+ """Output
19+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 56a908c5-c9f2-4ebf-a00a-895e49bd189b - 0 - Not started
20+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 56a908c5-c9f2-4ebf-a00a-895e49bd189b - 0 - In progress
21+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 56a908c5-c9f2-4ebf-a00a-895e49bd189b - 0 - Completed
22+ """
23+ system ("dotflow start --step examples.cli_with_callback.simple_step --callback examples.cli_with_callback.callback" )
24+
25+
26+ if __name__ == "__main__" :
27+ main ()
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ from os import system
4+
5+ from dotflow import action
6+
7+
8+ @action
9+ def simple_step ():
10+ return {"foo" : "bar" }
11+
12+
13+ def main ():
14+ """
15+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - Initial Context -> abc
16+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - Not started
17+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - In progress
18+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - Completed
19+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - Current Context -> {'foo': 'bar'}
20+ """
21+ system ("dotflow start --step examples.cli_with_initial_context.simple_step --initial-context abc --output" )
22+
23+
24+ if __name__ == "__main__" :
25+ main ()
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ from os import system
4+
5+ from dotflow import action
6+
7+
8+ @action
9+ def simple_step ():
10+ return {"foo" : "bar" }
11+
12+
13+ def main ():
14+ """
15+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - Initial Context -> None
16+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - Not started
17+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - In progress
18+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - Completed
19+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 5ace2ca5-3d88-4119-a064-a9ae048826e9 - 0 - Current Context -> {'foo': 'bar'}
20+ """
21+ system ("dotflow start --step examples.cli_with_output.simple_step --output" )
22+
23+
24+ if __name__ == "__main__" :
25+ main ()
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ from os import system
4+
5+ from dotflow import action
6+
7+
8+ @action
9+ def simple_step ():
10+ return "ok"
11+
12+
13+ def main ():
14+ """Output
15+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 56a908c5-c9f2-4ebf-a00a-895e49bd189b - 0 - Not started
16+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 56a908c5-c9f2-4ebf-a00a-895e49bd189b - 0 - In progress
17+ 0000-00-00 00:00:00,000 - INFO [dotflow]: ID 56a908c5-c9f2-4ebf-a00a-895e49bd189b - 0 - Completed
18+ """
19+ system ("dotflow start --step examples.cli_with_path.simple_step --path my_folder" )
20+ system ("dotflow start --step examples.cli_with_path.simple_step --path /home/your_user/log" )
21+ system ("dotflow start --step examples.cli_with_path.simple_step --path ." )
22+
23+
24+ if __name__ == "__main__" :
25+ main ()
Original file line number Diff line number Diff line change 22
33import unittest
44
5+ from examples .cli_with_callback import main as cli_with_callback
6+ from examples .cli_with_initial_context import main as cli_with_initial_context
7+ from examples .cli_with_output import main as cli_with_output
8+ from examples .cli_with_path import main as cli_with_path
9+ from examples .cli import main as cli
510from examples .simple_class_workflow import main as simple_class_workflow
611from examples .simple_function_workflow_with_error import main as simple_function_workflow_with_error
712from examples .simple_function_workflow import main as simple_function_workflow
2328
2429class TestIntegration (unittest .TestCase ):
2530
31+ def test_cli_with_callback (self ):
32+ cli_with_callback ()
33+
34+ def test_cli_with_initial_context (self ):
35+ cli_with_initial_context ()
36+
37+ def test_cli_with_output (self ):
38+ cli_with_output ()
39+
40+ def test_cli_with_path (self ):
41+ cli_with_path ()
42+
43+ def test_cli (self ):
44+ cli ()
45+
2646 def test_simple_class_workflow (self ):
2747 simple_class_workflow ()
2848
You can’t perform that action at this time.
0 commit comments