(self)
| 205 | MagicMock(return_value=False), |
| 206 | ) |
| 207 | def test_put(self): |
| 208 | hosts = ["localhost", "127.0.0.1", "st2build001"] |
| 209 | client = ParallelSSHClient( |
| 210 | hosts=hosts, user="ubuntu", pkey_file="~/.ssh/id_rsa", connect=True |
| 211 | ) |
| 212 | client.put("/local/stuff", "/remote/stuff", mode=0o744) |
| 213 | expected_kwargs = {"mode": 0o744, "mirror_local_mode": False} |
| 214 | for host in hosts: |
| 215 | hostname, _ = client._get_host_port_info(host) |
| 216 | client._hosts_client[hostname].put.assert_called_with( |
| 217 | "/local/stuff", "/remote/stuff", **expected_kwargs |
| 218 | ) |
| 219 | |
| 220 | @patch("paramiko.SSHClient", Mock) |
| 221 | @patch.object(ParamikoSSHClient, "delete_file", MagicMock(return_value={})) |
nothing calls this directly
no test coverage detected