@@ -74,7 +74,7 @@ def test_create_running_workflow():
74
74
response = utaa .create_workflow (workflow_definition = {"name" : "blah" })
75
75
76
76
# Act
77
- response = utaa .create_running_workflow (workflow_definition_id = response ["id" ])
77
+ response = utaa .create_running_workflow (workflow_id = response ["id" ])
78
78
79
79
# Assert
80
80
assert response ["id" ] == "r-workflow-00000000-0000-0000-0000-000000000001"
@@ -85,7 +85,7 @@ def test_get_running_workflow():
85
85
utaa = UnitTestAPIAdapter ()
86
86
response = utaa .create_workflow (workflow_definition = {"name" : "blah" })
87
87
wfid = response ["id" ]
88
- response = utaa .create_running_workflow (workflow_definition_id = wfid )
88
+ response = utaa .create_running_workflow (workflow_id = wfid )
89
89
rwfid = response ["id" ]
90
90
91
91
# Act
@@ -97,11 +97,43 @@ def test_get_running_workflow():
97
97
assert rwf ["workflow" ] == wfid
98
98
99
99
100
+ def test_set_running_workflow_done_when_success ():
101
+ # Arrange
102
+ utaa = UnitTestAPIAdapter ()
103
+ response = utaa .create_workflow (workflow_definition = {"name" : "blah" })
104
+ response = utaa .create_running_workflow (workflow_id = response ["id" ])
105
+ rwfid = response ["id" ]
106
+
107
+ # Act
108
+ utaa .set_running_workflow_done (running_workflow_id = rwfid , success = True )
109
+
110
+ # Assert
111
+ response = utaa .get_running_workflow (running_workflow_id = rwfid )
112
+ assert response ["running_workflow" ]["done" ]
113
+ assert response ["running_workflow" ]["success" ]
114
+
115
+
116
+ def test_set_running_workflow_done_when_failed ():
117
+ # Arrange
118
+ utaa = UnitTestAPIAdapter ()
119
+ response = utaa .create_workflow (workflow_definition = {"name" : "blah" })
120
+ response = utaa .create_running_workflow (workflow_id = response ["id" ])
121
+ rwfid = response ["id" ]
122
+
123
+ # Act
124
+ utaa .set_running_workflow_done (running_workflow_id = rwfid , success = False )
125
+
126
+ # Assert
127
+ response = utaa .get_running_workflow (running_workflow_id = rwfid )
128
+ assert response ["running_workflow" ]["done" ]
129
+ assert not response ["running_workflow" ]["success" ]
130
+
131
+
100
132
def test_create_running_workflow_step ():
101
133
# Arrange
102
134
utaa = UnitTestAPIAdapter ()
103
135
response = utaa .create_workflow (workflow_definition = {"name" : "blah" })
104
- response = utaa .create_running_workflow (workflow_definition_id = response ["id" ])
136
+ response = utaa .create_running_workflow (workflow_id = response ["id" ])
105
137
106
138
# Act
107
139
response = utaa .create_running_workflow_step (
@@ -117,7 +149,7 @@ def test_get_running_workflow_step():
117
149
utaa = UnitTestAPIAdapter ()
118
150
response = utaa .create_workflow (workflow_definition = {"name" : "blah" })
119
151
wfid = response ["id" ]
120
- response = utaa .create_running_workflow (workflow_definition_id = wfid )
152
+ response = utaa .create_running_workflow (workflow_id = wfid )
121
153
rwfid = response ["id" ]
122
154
response = utaa .create_running_workflow_step (
123
155
running_workflow_id = rwfid , step = "step-1"
@@ -139,7 +171,7 @@ def test_get_running_workflow_steps():
139
171
utaa = UnitTestAPIAdapter ()
140
172
response = utaa .create_workflow (workflow_definition = {"name" : "blah" })
141
173
wfid = response ["id" ]
142
- response = utaa .create_running_workflow (workflow_definition_id = wfid )
174
+ response = utaa .create_running_workflow (workflow_id = wfid )
143
175
rwfid = response ["id" ]
144
176
response = utaa .create_running_workflow_step (
145
177
running_workflow_id = rwfid , step = "step-1"
0 commit comments