turbaszek commented on a change in pull request #9322:
URL: https://github.com/apache/airflow/pull/9322#discussion_r451453234
##########
File path: tests/api_connexion/endpoints/test_dag_source_endpoint.py
##########
@@ -40,7 +50,83 @@ def setUpClass(cls) -> None:
def setUp(self) -> None:
self.client = self.app.test_client() # type:ignore
- @pytest.mark.skip(reason="Not implemented yet")
- def test_should_response_200(self):
- response = self.client.get("/api/v1/health")
- assert response.status_code == 200
+ @staticmethod
+ def _get_dag_file_docstring(fileloc: str) -> str:
+ with open(fileloc) as f:
+ file_contents = f.read()
+ module = ast.parse(file_contents)
+ docstring = ast.get_docstring(module)
+ return docstring
+
+ @parameterized.expand([("True",), ("False",)])
+ def test_should_response_200_text(self, store_dag_code):
+ serializer = URLSafeSerializer(conf.get('webserver', 'SECRET_KEY'))
+ with conf_vars(
+ {("core", "store_serialized_dags"): store_dag_code}
+ ):
+ dagbag = DagBag(dag_folder=EXAMPLE_DAG_FILE)
+ dagbag.sync_to_db()
Review comment:
Yup, I would add this in setup and teardown
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]