This is an automated email from the ASF dual-hosted git repository.

shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 6061e081f6c Remove duplicate SFTP missing-file sensor test (#75901)
6061e081f6c is described below

commit 6061e081f6cdc11fa4b5583a904868b44e857f7f
Author: Hussein Awala <[email protected]>
AuthorDate: Thu Oct 29 06:23:14 2026 +0100

    Remove duplicate SFTP missing-file sensor test (#75901)
    
    Both sensor tests mock isfile=False with identical path, context and hook 
assertions; the retained missing-file case covers that sensor behavior.
---
 providers/sftp/tests/unit/sftp/sensors/test_sftp.py | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/providers/sftp/tests/unit/sftp/sensors/test_sftp.py 
b/providers/sftp/tests/unit/sftp/sensors/test_sftp.py
index 5bb43418620..e41689b30c4 100644
--- a/providers/sftp/tests/unit/sftp/sensors/test_sftp.py
+++ b/providers/sftp/tests/unit/sftp/sensors/test_sftp.py
@@ -66,21 +66,8 @@ class TestSFTPSensor:
         sftp_hook_mock.return_value.close_conn.assert_not_called()
         assert output
 
-    @patch("airflow.providers.sftp.sensors.sftp.SFTPHook")
-    def test_file_irregular(self, sftp_hook_mock):
-        # This mocks the behavior of SFTPHook.isfile when an OSError is raised 
in that method, resulting in
-        # False being returned
-        sftp_hook_mock.return_value.isfile.return_value = False
-        sftp_sensor = SFTPSensor(task_id="unit_test", 
path="/path/to/file/1970-01-01.txt")
-        context = {"ds": "1970-01-01"}
-        output = sftp_sensor.poke(context)
-        
sftp_hook_mock.return_value.isfile.assert_called_once_with("/path/to/file/1970-01-01.txt")
-        sftp_hook_mock.return_value.close_conn.assert_not_called()
-        assert not output
-
     @patch("airflow.providers.sftp.sensors.sftp.SFTPHook")
     def test_file_absent(self, sftp_hook_mock):
-        # This is the same implementation above, however, it's simulating 
instead the absence of a file
         sftp_hook_mock.return_value.isfile.return_value = False
         sftp_sensor = SFTPSensor(task_id="unit_test", 
path="/path/to/file/1970-01-01.txt")
         context = {"ds": "1970-01-01"}

Reply via email to