def test_already_finished_job(mock_run, mock_api_cls):
    jobstep_id = uuid4()

    jobstep_data = generate_jobstep_data()
    jobstep_data['status']['id'] = 'finished'

    mock_api = mock_api_cls.return_value
    mock_api.get_jobstep.return_value = jobstep_data

    command = WrapperCommand([
        '--jobstep-id', jobstep_id.hex,
        '--api-url', 'http://changes.example.com',
    ])
    command.run()

    assert not mock_run.called