def test_wait_for_task_id_fails_request(response_code): responses.add(responses.GET, "http://gman_url/task/1234/events", status=response_code) with pytest.raises(requests.exceptions.HTTPError): client.wait_for_task_status(task_id="1234", status="completed", gman_url="http://gman_url")
def test_wait_for_task_id_task_fails(task_event_list_failures): responses.add(responses.GET, "http://gman_url/task/1234/events", json=task_event_list_failures) with pytest.raises(TaskError): client.wait_for_task_status(task_id="1234", status="running", gman_url="http://gman_url", retry_max=2)
def test_wait_for_task_id(task_event_list): responses.add(responses.GET, "http://gman_url/task/1234/events", json=task_event_list) resp = client.wait_for_task_status(task_id="1234", status="completed", gman_url="http://gman_url") assert resp
def test_wait_for_task_id_request_exception(mock_get_request_exception): with pytest.raises(requests.exceptions.RequestException): client.wait_for_task_status(task_id="1234", status="running", gman_url="http://gman_url", retry_max=2)