Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sftp sensor with pattern (#29467)
* Solve file_pattern issue with file path creation This solves #28121 * Correct file_by_pattern.return_value in test The output of SFTPHook.get_file_by_pattern is a file name and not the full path to the file. * Remove test_file_with_pattern_parameter_call To my understanding, the goal of `test_file_with_pattern_parameter_call` is to test whether we can call the function with the `file_pattern` parameter. Due to the previous changes, the `os.path.join` requires to set a value for `sftp_hook_mock.return_value.get_file_by_pattern.return_value` so that the `poke` function would run. The case where we set this value is dealt with `test_file_present_with_pattern` and `test_file_not_present_with_pattern`. `test_file_with_pattern_parameter_call` thus does not test anything different or more specific than the two other tests. --------- Co-authored-by: b.ramsauer@swiss-sdi.ch <b.ramsauer@swiss-sdi.ch>
- Loading branch information