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

Method test_delete_dir

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

Source from the content-addressed store, hash-verified

244 MagicMock(return_value=False),
245 )
246 def test_delete_dir(self):
247 hosts = ["localhost", "127.0.0.1", "st2build001"]
248 client = ParallelSSHClient(
249 hosts=hosts, user="ubuntu", pkey_file="~/.ssh/id_rsa", connect=True
250 )
251 client.delete_dir("/remote/stuff/", force=True)
252 expected_kwargs = {"force": True, "timeout": None}
253 for host in hosts:
254 hostname, _ = client._get_host_port_info(host)
255 client._hosts_client[hostname].delete_dir.assert_called_with(
256 "/remote/stuff/", **expected_kwargs
257 )
258
259 @patch("paramiko.SSHClient", Mock)
260 @patch.object(

Callers

nothing calls this directly

Calls 3

delete_dirMethod · 0.95
_get_host_port_infoMethod · 0.95
ParallelSSHClientClass · 0.90

Tested by

no test coverage detected