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.providers.standard.sensors.external_task import ExternalTaskSensor
from airflow.sdk.definitions.asset import Asset

from tests_common.test_utils.asserts import assert_queries_count
from tests_common.test_utils.db import clear_db_dags, clear_db_serialized_dags

pytestmark = pytest.mark.db_test
Expand Down Expand Up @@ -203,7 +204,8 @@ def expected_secondary_component_response(asset2_id):
class TestGetDependencies:
@pytest.mark.usefixtures("make_primary_connected_component")
def test_should_response_200(self, test_client, expected_primary_component_response):
response = test_client.get("/dependencies")
with assert_queries_count(5):
response = test_client.get("/dependencies")
assert response.status_code == 200

assert response.json() == expected_primary_component_response
Expand Down Expand Up @@ -238,7 +240,8 @@ def test_delete_dag_should_response_403(self, unauthorized_test_client):
@pytest.mark.usefixtures("make_primary_connected_component", "make_secondary_connected_component")
def test_with_node_id_filter(self, test_client, node_id, expected_response_fixture, request):
expected_response = request.getfixturevalue(expected_response_fixture)
response = test_client.get("/dependencies", params={"node_id": node_id})
with assert_queries_count(5):
response = test_client.get("/dependencies", params={"node_id": node_id})
assert response.status_code == 200

assert response.json() == expected_response
Expand All @@ -255,7 +258,8 @@ def test_with_node_id_filter_with_asset(
(asset1_id, expected_primary_component_response),
(asset2_id, expected_secondary_component_response),
):
response = test_client.get("/dependencies", params={"node_id": f"asset:{asset_id}"})
with assert_queries_count(5):
response = test_client.get("/dependencies", params={"node_id": f"asset:{asset_id}"})
assert response.status_code == 200

assert response.json() == expected_response
Expand Down
Loading