()
| 186 | |
| 187 | |
| 188 | def test_remix_step() -> None: |
| 189 | args_1 =\ |
| 190 | { |
| 191 | 'source_path': 'source-1.jpg', |
| 192 | 'target_path': 'target-1.jpg', |
| 193 | 'output_path': 'output-1.jpg' |
| 194 | } |
| 195 | args_2 =\ |
| 196 | { |
| 197 | 'source_path': 'source-2.jpg', |
| 198 | 'target_path': 'target-2.jpg', |
| 199 | 'output_path': 'output-2.jpg' |
| 200 | } |
| 201 | |
| 202 | assert remix_step('job-invalid', 0, args_1) is False |
| 203 | |
| 204 | create_job('job-test-remix-step') |
| 205 | add_step('job-test-remix-step', args_1) |
| 206 | add_step('job-test-remix-step', args_2) |
| 207 | |
| 208 | assert remix_step('job-test-remix-step', 99, args_1) is False |
| 209 | assert remix_step('job-test-remix-step', 0, args_2) is True |
| 210 | assert remix_step('job-test-remix-step', -1, args_2) is True |
| 211 | |
| 212 | steps = get_steps('job-test-remix-step') |
| 213 | |
| 214 | assert steps[0].get('args') == args_1 |
| 215 | assert steps[1].get('args') == args_2 |
| 216 | assert steps[2].get('args').get('source_path') == args_2.get('source_path') |
| 217 | assert steps[2].get('args').get('target_path') == get_step_output_path('job-test-remix-step', 0, args_1.get('output_path')) |
| 218 | assert steps[2].get('args').get('output_path') == args_2.get('output_path') |
| 219 | assert steps[3].get('args').get('source_path') == args_2.get('source_path') |
| 220 | assert steps[3].get('args').get('target_path') == get_step_output_path('job-test-remix-step', 2, args_2.get('output_path')) |
| 221 | assert steps[3].get('args').get('output_path') == args_2.get('output_path') |
| 222 | assert count_step_total('job-test-remix-step') == 4 |
| 223 | |
| 224 | |
| 225 | def test_insert_step() -> None: |
nothing calls this directly
no test coverage detected