Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from airflow.utils.state import DagRunState
from airflow.utils.types import DagRunType

from tests_common.test_utils.asserts import assert_queries_count
from tests_common.test_utils.db import (
clear_db_dag_bundles,
clear_db_dags,
Expand Down Expand Up @@ -193,7 +194,8 @@ def test_should_respond_200(self, test_client, session, testing_dag_bundle):
"total_entries": 2,
}

response = test_client.get(f"{API_PREFIX}?dag_ids={DAG1_ID}&dag_ids={DAG2_ID}")
with assert_queries_count(2):
response = test_client.get(f"{API_PREFIX}?dag_ids={DAG1_ID}&dag_ids={DAG2_ID}")
assert response.status_code == 200
res_json = response.json()
assert res_json["total_entries"] == len(res_json["dags"])
Expand Down Expand Up @@ -281,7 +283,8 @@ def test_all_dags_should_respond_200(self, test_client, session, testing_dag_bun
"total_entries": 3,
}

response = test_client.get(API_PREFIX)
with assert_queries_count(2):
response = test_client.get(API_PREFIX)
assert response.status_code == 200
res_json = response.json()
assert res_json["total_entries"] == len(res_json["dags"])
Expand Down Expand Up @@ -435,7 +438,9 @@ def test_all_dags_should_respond_200(self, test_client, session, testing_dag_bun
)
def test_single_dag_in_dag_ids(self, test_client, session, testing_dag_bundle, url, params, exp_payload):
self._create_dag_and_runs(session)
response = test_client.get(url, params=params)

with assert_queries_count(2):
response = test_client.get(url, params=params)
assert response.status_code == 200
res_json = response.json()
assert res_json["total_entries"] == len(res_json["dags"])
Expand Down
Loading