def test_ssh_run_cmd_with_remote_cwd(self, run_cmd): ssh_run_cmd('user@remote', ['touch', '"#'], remote_cwd='workspace') run_cmd.assert_called_with(['ssh', '-q', '-oStrictHostKeyChecking=no', '-oUserKnownHostsFile=/dev/null', 'user@remote', 'mkdir -p workspace ; cd workspace ; touch \'"#\''])
def test_ssh_run_cmd(self, run_cmd): ssh_run_cmd('user@remote', ['touch', '"#']) run_cmd.assert_called_with(['ssh', '-q', '-oStrictHostKeyChecking=no', '-oUserKnownHostsFile=/dev/null', 'user@remote', 'touch \'"#\''])
def run_cmd(self, *args, **kwargs): return ssh_run_cmd(self._ssh_connect_string, *args, remote_cwd='workspace', **kwargs)