kaxil commented on code in PR #45305:
URL: https://github.com/apache/airflow/pull/45305#discussion_r1903993720


##########
tests/dag_processing/test_processor.py:
##########
@@ -164,6 +167,51 @@ def fake_collect_dags(dagbag: DagBag, *args, **kwargs):
 #         mock_redirect_stdout_for_file.assert_called_once()
 
 
[email protected]
+def disable_capturing():
+    old_in, old_out, old_err = sys.stdin, sys.stdout, sys.stderr
+
+    sys.stdin = sys.__stdin__
+    sys.stdout = sys.__stdout__
+    sys.stderr = sys.__stderr__
+    yield
+    sys.stdin, sys.stdout, sys.stderr = old_in, old_out, old_err
+
+
[email protected]("disable_capturing")
+def test_parse_file_entrypoint_parses_dag_callbacks(spy_agency):
+    r, w = socketpair()
+    # Create a valid FD for the decoder to open
+    _, w2 = socketpair()
+
+    w.makefile("wb").write(
+        b'{"file":"/files/dags/wait.py","requests_fd":'
+        + str(w2.fileno()).encode("ascii")
+        + b',"callback_requests": [{"full_filepath": "/files/dags/wait.py", '
+        b'"msg": "task_failure", "dag_id": "wait_to_fail", "run_id": '
+        b'"manual__2024-12-30T21:02:55.203691+00:00", '
+        b'"is_failure_callback": true, "type": "DagCallbackRequest"}], "type": 
"DagFileParseRequest"}\n'
+    )
+
+    decoder = CommsDecoder[DagFileParseRequest, DagFileParsingResult](
+        input=r.makefile("r"),
+        decoder=TypeAdapter[DagFileParseRequest](DagFileParseRequest),
+    )
+

Review Comment:
   Do we already have the test for its serialization too?



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