MCPcopy Create free account
hub / github.com/StackStorm/st2 / test_put

Method test_put

st2actions/tests/unit/test_parallel_ssh.py:207–218  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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={}))

Callers

nothing calls this directly

Calls 3

putMethod · 0.95
_get_host_port_infoMethod · 0.95
ParallelSSHClientClass · 0.90

Tested by

no test coverage detected