ephraimbuddy commented on a change in pull request #9170:
URL: https://github.com/apache/airflow/pull/9170#discussion_r439765685



##########
File path: tests/api_connexion/endpoints/test_xcom_endpoint.py
##########
@@ -18,59 +18,153 @@
 
 import pytest
 
+from airflow.models import DagRun as DR, XCom
+from airflow.utils.dates import parse_execution_date
+from airflow.utils.session import create_session, provide_session
+from airflow.utils.types import DagRunType
 from airflow.www import app
 
 
-class TesXComEndpoint(unittest.TestCase):
+class TestXComEndpoint(unittest.TestCase):
     @classmethod
     def setUpClass(cls) -> None:
         super().setUpClass()
         cls.app = app.create_app(testing=True)  # type:ignore
 
     def setUp(self) -> None:
         self.client = self.app.test_client()  # type:ignore
+        # clear existing xcoms
+        with create_session() as session:
+            session.query(XCom).delete()
+            session.query(DR).delete()
 
 
-class TestDeleteXComEntry(TesXComEndpoint):
+class TestDeleteXComEntry(TestXComEndpoint):
     @pytest.mark.skip(reason="Not implemented yet")
     def test_should_response_200(self):
         response = self.client.delete(
-            
"/dags/TEST_DAG_ID}/taskInstances/TEST_TASK_ID/2005-04-02T21:37:42Z/xcomEntries/XCOM_KEY"
+            
"/dags/TEST_DAG_ID/taskInstances/TEST_TASK_ID/2005-04-02T21:37:42Z/xcomEntries/XCOM_KEY"
         )
         assert response.status_code == 204
 
 
-class TestGetXComEntry(TesXComEndpoint):
-    @pytest.mark.skip(reason="Not implemented yet")
-    def test_should_response_200(self):
+class TestGetXComEntry(TestXComEndpoint):
+
+    @provide_session
+    def test_should_response_200(self, session):
+        dag_id = 'test-dag-id'
+        task_id = 'test-task-id'
+        execution_date = '2005-04-02T21:37:42+00:00'

Review comment:
       ```suggestion
           execution_date = '2005-04-02T21:00:00+00:00'
   ```
   The date will be readable this way




----------------------------------------------------------------
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]


Reply via email to