kyupark commented on code in PR #66850:
URL: https://github.com/apache/airflow/pull/66850#discussion_r3253387439
##########
providers/imap/tests/unit/imap/hooks/test_imap.py:
##########
@@ -509,3 +509,117 @@ def test_has_mail_attachment_with_max_mails(self,
mock_imaplib):
assert result is True
assert 1 <= mock_conn.fetch.call_count <= 2
+
+ @patch(open_string, new_callable=mock_open)
+ @patch(imaplib_string)
+ def test_download_attachments_overwrite_default(self, mock_imaplib,
mock_open_method):
Review Comment:
Thanks, good point. Added a focused test for this path: the first `open(...,
"xb")` for `report.csv` raises `FileExistsError`, then the retry succeeds with
`report_1.csv`.
Local checks passed: ruff format/check on `test_imap.py`, plus the full IMAP
hook test file (`41 passed`). CI is green as well.
--
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]