File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from metaflow .plugins .argo .argo_workflows import WorkflowSpec
2+
3+
4+ def test_positive_value ():
5+ spec = WorkflowSpec ()
6+ spec .ttl_strategy (86400 )
7+ assert spec .payload ["ttlStrategy" ] == {"secondsAfterCompletion" : 86400 }
8+
9+
10+ def test_zero_no_ttl ():
11+ spec = WorkflowSpec ()
12+ spec .ttl_strategy (0 )
13+ assert "ttlStrategy" not in spec .payload
14+
15+
16+ def test_none_no_ttl ():
17+ spec = WorkflowSpec ()
18+ spec .ttl_strategy (None )
19+ assert "ttlStrategy" not in spec .payload
20+
21+
22+ def test_string_value_converted_to_int ():
23+ spec = WorkflowSpec ()
24+ spec .ttl_strategy ("86400" )
25+ assert spec .payload ["ttlStrategy" ] == {"secondsAfterCompletion" : 86400 }
26+
27+
28+ def test_negative_value_no_ttl ():
29+ spec = WorkflowSpec ()
30+ spec .ttl_strategy (- 1 )
31+ assert "ttlStrategy" not in spec .payload
You can’t perform that action at this time.
0 commit comments