danarwix commented on a change in pull request #18973:
URL: https://github.com/apache/airflow/pull/18973#discussion_r735085527



##########
File path: tests/api_connexion/schemas/test_xcom_schema.py
##########
@@ -29,169 +29,165 @@
 from airflow.utils.session import create_session, provide_session
 
 
+class MockXcomCollectionItem:
+    DEFAULT_TIME = '2005-04-02T21:00:00+00:00'
+    DEFAULT_TIME_PARSED = parse_execution_date(DEFAULT_TIME)
+
+    def __init__(self):
+        self.example_ref = uuid.uuid4()
+        self.key: str = f'test_key_{self.example_ref}'
+        self.timestamp: datetime.datetime = self.DEFAULT_TIME_PARSED
+        self.execution_date: datetime.datetime = self.DEFAULT_TIME_PARSED
+        self.task_id = f'test_task_id_{self.example_ref}'
+        self.dag_id = f'test_dag_{self.example_ref}'
+
+    @property
+    def as_xcom(self):
+        return XCom(
+            key=self.key,
+            timestamp=self.timestamp,
+            execution_date=self.execution_date,
+            task_id=self.task_id,
+            dag_id=self.dag_id,
+        )
+
+    @property
+    def deserialized_xcom(self):
+        return {
+            'key': self.key,
+            'timestamp': self.DEFAULT_TIME,
+            'execution_date': self.DEFAULT_TIME,
+            'task_id': self.task_id,
+            'dag_id': self.dag_id,
+        }
+
+    @property
+    def from_dump_xcom(self):

Review comment:
       That property is supposed to mock a return value that will match the 
usage of using `xcom.dump`
   
   I guess i chose a name that dosent describe it
   How would you call it?




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


Reply via email to