stegololz commented on code in PR #73288:
URL: https://github.com/apache/airflow/pull/73288#discussion_r4060249996
##########
providers/sftp/tests/unit/sftp/pools/test_sftp.py:
##########
@@ -88,6 +89,71 @@ async def
test_get_sftp_client_marks_connection_faulty_on_exception(self, sftp_h
assert any(call.kwargs.get("faulty") is True for call in
release_spy.call_args_list)
+ @pytest.mark.parametrize(
+ ("exc", "expected"),
+ [
+ pytest.param(asyncssh.SFTPNoSuchFile("missing"), False,
id="no-such-file"),
+ pytest.param(asyncssh.SFTPPermissionDenied("denied"), False,
id="permission-denied"),
+ pytest.param(asyncssh.SFTPFailure("failure"), False, id="failure"),
+ pytest.param(asyncssh.SFTPOpUnsupported("unsupported"), False,
id="op-unsupported"),
+ pytest.param(asyncssh.SFTPConnectionLost("lost"), True,
id="connection-lost"),
+ pytest.param(asyncssh.SFTPNoConnection("no connection"), True,
id="no-connection"),
+ pytest.param(asyncssh.SFTPBadMessage("bad message"), True,
id="bad-message"),
+ pytest.param(ValueError("boom"), True, id="not-an-sftp-error"),
Review Comment:
done
--
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]