mik-laj commented on a change in pull request #16842:
URL: https://github.com/apache/airflow/pull/16842#discussion_r664979943
##########
File path: tests/api_connexion/endpoints/test_dag_endpoint.py
##########
@@ -137,54 +155,44 @@ def _create_deactivated_dag(self, session=None):
class TestGetDag(TestDagEndpoint):
- @conf_vars({("webserver", "secret_key"): "mysecret"})
def test_should_respond_200(self):
- self._create_dag_models(1)
- response = self.client.get("/api/v1/dags/TEST_DAG_1",
environ_overrides={'REMOTE_USER': "test"})
+ response = self.client.get(f"/api/v1/dags/{self.dag_id}",
environ_overrides={'REMOTE_USER': "test"})
assert response.status_code == 200
assert {
- "dag_id": "TEST_DAG_1",
+ "dag_id": self.dag_id,
"description": None,
- "fileloc": "/tmp/dag_1.py",
- "file_token": 'Ii90bXAvZGFnXzEucHki.EnmIdPaUPo26lHQClbWMbDFD1Pk',
- "is_paused": False,
- "is_active": True,
+ "fileloc": __file__,
+ "file_token": FILE_TOKEN,
+ "is_paused": None,
"is_subdag": False,
"owners": [],
- "root_dag_id": None,
- "schedule_interval": {"__type": "CronExpression", "value": "2 2 *
* *"},
- "tags": [],
+ "schedule_interval": {
+ "__type": "TimeDelta",
+ "days": 1,
+ "microseconds": 0,
+ "seconds": 0,
+ },
+ "tags": [{'name': 'example'}],
} == response.json
- @conf_vars({("webserver", "secret_key"): "mysecret"})
def test_should_respond_200_with_schedule_interval_none(self, session):
- dag_model = DagModel(
- dag_id="TEST_DAG_1",
- fileloc="/tmp/dag_1.py",
- schedule_interval=None,
- )
- session.add(dag_model)
- session.commit()
- response = self.client.get("/api/v1/dags/TEST_DAG_1",
environ_overrides={'REMOTE_USER': "test"})
+ response = self.client.get(f"/api/v1/dags/{self.dag4_id}",
environ_overrides={'REMOTE_USER': "test"})
assert response.status_code == 200
assert {
- "dag_id": "TEST_DAG_1",
+ "dag_id": self.dag4_id,
"description": None,
- "fileloc": "/tmp/dag_1.py",
- "file_token": 'Ii90bXAvZGFnXzEucHki.EnmIdPaUPo26lHQClbWMbDFD1Pk',
- "is_paused": False,
- "is_active": False,
+ "fileloc": __file__,
+ "file_token": FILE_TOKEN,
+ "is_paused": None,
Review comment:
is_active is missing here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]