Skip to content

Commit

Permalink
airflow#36110 - adding test
Browse files Browse the repository at this point in the history
  • Loading branch information
pateash committed Dec 18, 2023
1 parent 99dbe3d commit 97fb3d8
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions tests/api_connexion/endpoints/test_dag_run_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,11 +1189,11 @@ def test_should_respond_400_if_a_dag_has_import_errors(self, session):
environ_overrides={"REMOTE_USER": "test"},
)
assert {
"detail": "DAG with dag_id: 'TEST_DAG_ID' has import errors",
"status": 400,
"title": "DAG cannot be triggered",
"type": EXCEPTIONS_LINK_MAP[400],
} == response.json
"detail": "DAG with dag_id: 'TEST_DAG_ID' has import errors",
"status": 400,
"title": "DAG cannot be triggered",
"type": EXCEPTIONS_LINK_MAP[400],
} == response.json

def test_should_response_200_for_matching_execution_date_logical_date(self):
execution_date = "2020-11-10T08:25:56.939143+00:00"
Expand Down Expand Up @@ -1298,11 +1298,11 @@ def test_response_404(self):
)
assert response.status_code == 404
assert {
"detail": "DAG with dag_id: 'TEST_DAG_ID' not found",
"status": 404,
"title": "DAG not found",
"type": EXCEPTIONS_LINK_MAP[404],
} == response.json
"detail": "DAG with dag_id: 'TEST_DAG_ID' not found",
"status": 404,
"title": "DAG not found",
"type": EXCEPTIONS_LINK_MAP[404],
} == response.json

@pytest.mark.parametrize(
"url, request_json, expected_response",
Expand Down Expand Up @@ -1353,7 +1353,7 @@ def test_response_409(self):
assert response.status_code == 409, response.data
assert response.json == {
"detail": "DAGRun with DAG ID: 'TEST_DAG_ID' and "
"DAGRun ID: 'TEST_DAG_RUN_ID_1' already exists",
"DAGRun ID: 'TEST_DAG_RUN_ID_1' already exists",
"status": 409,
"title": "Conflict",
"type": EXCEPTIONS_LINK_MAP[409],
Expand All @@ -1374,7 +1374,7 @@ def test_response_409_when_execution_date_is_same(self):
assert response.status_code == 409, response.data
assert response.json == {
"detail": "DAGRun with DAG ID: 'TEST_DAG_ID' and "
"DAGRun logical date: '2020-06-11 18:00:00+00:00' already exists",
"DAGRun logical date: '2020-06-11 18:00:00+00:00' already exists",
"status": 409,
"title": "Conflict",
"type": EXCEPTIONS_LINK_MAP[409],
Expand Down Expand Up @@ -1872,8 +1872,6 @@ def test_should_respond_200_with_anonymous_user(self, dag_maker, session):
created_dr = dag_runs[0]
response = self.client.post(
f"api/v1/dags/{created_dr.dag_id}/dagRuns",
json={
"dag_run_id": "TEST_DAG_RUN_ID_1",
"note": "I am setting a note with anonymous user"},
json={"dag_run_id": "TEST_DAG_RUN_ID_1", "note": "I am setting a note with anonymous user"},
)
assert response.status_code == 200

0 comments on commit 97fb3d8

Please sign in to comment.