This is an automated email from the ASF dual-hosted git repository.
gopidesu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new aa30ed90e32 Assert dict with deepdiff (#45191)
aa30ed90e32 is described below
commit aa30ed90e32d2eb10126b92bf9ae54cbdcc5ab95
Author: GPK <[email protected]>
AuthorDate: Tue Dec 24 04:44:51 2024 +0000
Assert dict with deepdiff (#45191)
---
hatch_build.py | 1 +
tests/api_fastapi/core_api/routes/ui/test_structure.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hatch_build.py b/hatch_build.py
index 5b67d3f7c2e..c3aef3defe3 100644
--- a/hatch_build.py
+++ b/hatch_build.py
@@ -255,6 +255,7 @@ DEVEL_EXTRAS: dict[str, list[str]] = {
"beautifulsoup4>=4.7.1",
# Coverage 7.4.0 added experimental support for Python 3.12 PEP669
which we use in Airflow
"coverage>=7.4.0",
+ "deepdiff>=8.1.1",
"jmespath>=0.7.0",
"kgb>=7.0.0",
"pytest-asyncio>=0.23.6",
diff --git a/tests/api_fastapi/core_api/routes/ui/test_structure.py
b/tests/api_fastapi/core_api/routes/ui/test_structure.py
index 8efc6dc9d12..9732269944d 100644
--- a/tests/api_fastapi/core_api/routes/ui/test_structure.py
+++ b/tests/api_fastapi/core_api/routes/ui/test_structure.py
@@ -19,6 +19,7 @@ from __future__ import annotations
import pendulum
import pytest
+from deepdiff import DeepDiff
from airflow.models import DagBag
from airflow.operators.empty import EmptyOperator
@@ -404,7 +405,7 @@ class TestStructureDataEndpoint:
def test_should_return_200(self, test_client, params, expected):
response = test_client.get("/ui/structure/structure_data",
params=params)
assert response.status_code == 200
- assert response.json() == expected
+ assert not DeepDiff(response.json(), expected, ignore_order=True)
def test_should_return_404(self, test_client):
response = test_client.get("/ui/structure/structure_data",
params={"dag_id": "not_existing"})