Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gyandeeps committed Oct 16, 2024
1 parent 5064bfa commit 452d4c4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions providers/tests/ssh/hooks/test_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ def test_ssh_connection_with_password(self, ssh_mock):
port="port",
sock=None,
look_for_keys=True,
auth_timeout=None,
)

@mock.patch("airflow.providers.ssh.hooks.ssh.paramiko.SSHClient")
Expand All @@ -381,6 +382,7 @@ def test_ssh_connection_without_password(self, ssh_mock):
port="port",
sock=None,
look_for_keys=True,
auth_timeout=None,
)

@mock.patch("airflow.providers.ssh.hooks.ssh.SSHTunnelForwarder")
Expand Down Expand Up @@ -569,6 +571,7 @@ def test_ssh_connection_with_private_key_extra(self, ssh_mock):
port="port",
sock=None,
look_for_keys=True,
auth_timeout=None,
)

@mock.patch("airflow.providers.ssh.hooks.ssh.paramiko.SSHClient")
Expand All @@ -592,6 +595,7 @@ def test_ssh_connection_with_private_key_passphrase_extra(self, ssh_mock):
port="port",
sock=None,
look_for_keys=True,
auth_timeout=None,
)

@mock.patch("airflow.providers.ssh.hooks.ssh.paramiko.SSHClient")
Expand Down Expand Up @@ -654,6 +658,7 @@ def test_ssh_connection_with_conn_timeout(self, ssh_mock):
password="password",
conn_timeout=20,
key_file="fake.file",
auth_timeout=10,
)

with hook.get_conn():
Expand All @@ -668,6 +673,7 @@ def test_ssh_connection_with_conn_timeout(self, ssh_mock):
port="port",
sock=None,
look_for_keys=True,
auth_timeout=10,
)

@mock.patch("airflow.providers.ssh.hooks.ssh.paramiko.SSHClient")
Expand Down Expand Up @@ -695,6 +701,7 @@ def test_ssh_connection_with_conn_timeout_and_timeout(self, ssh_mock):
port="port",
sock=None,
look_for_keys=True,
auth_timeout=None,
)

@mock.patch("airflow.providers.ssh.hooks.ssh.paramiko.SSHClient")
Expand All @@ -718,6 +725,7 @@ def test_ssh_connection_with_timeout_extra(self, ssh_mock):
port="port",
sock=None,
look_for_keys=True,
auth_timeout=None,
)

@mock.patch("airflow.providers.ssh.hooks.ssh.paramiko.SSHClient")
Expand All @@ -743,6 +751,7 @@ def test_ssh_connection_with_conn_timeout_extra(self, ssh_mock):
port="port",
sock=None,
look_for_keys=True,
auth_timeout=None,
)

@mock.patch("airflow.providers.ssh.hooks.ssh.paramiko.SSHClient")
Expand All @@ -768,6 +777,7 @@ def test_ssh_connection_with_timeout_extra_and_conn_timeout_extra(self, ssh_mock
port="port",
sock=None,
look_for_keys=True,
auth_timeout=None,
)

@pytest.mark.parametrize(
Expand Down Expand Up @@ -837,6 +847,7 @@ def test_ssh_connection_with_all_timeout_param_and_extra_combinations(
port="port",
sock=None,
look_for_keys=True,
auth_timeout=None,
)

@pytest.mark.parametrize(
Expand Down Expand Up @@ -901,6 +912,7 @@ def test_ssh_with_extra_disabled_algorithms(self, ssh_mock):
sock=None,
look_for_keys=True,
disabled_algorithms=TEST_DISABLED_ALGORITHMS,
auth_timeout=None,
)

@mock.patch("airflow.providers.ssh.hooks.ssh.paramiko.SSHClient")
Expand Down

0 comments on commit 452d4c4

Please sign in to comment.