

@patch('st2actions.runners.ssh.parallel_ssh.ParallelSSHClient', Mock)
@patch.object(jsonify, 'json_loads', MagicMock(return_value={
    
}))
@patch.object(ParallelSSHClient, 'run', MagicMock(return_value={
    
}))
@patch.object(ParallelSSHClient, 'connect', MagicMock(return_value={
    
}))
def test_cwd_used_correctly(self):
    remote_action = ParamikoRemoteScriptAction('foo-script', bson.ObjectId(), script_local_path_abs='/home/stanley/shiz_storm.py', script_local_libs_path_abs=None, named_args={
        
    }, positional_args=['blank space'], env_vars={
        
    }, on_behalf_user='svetlana', user='stanley', private_key='---SOME RSA KEY---', remote_dir='/tmp', hosts=['127.0.0.1'], cwd='/test/cwd/')
    paramiko_runner = ParamikoRemoteScriptRunner('runner_1')
    paramiko_runner._parallel_ssh_client = ParallelSSHClient(['127.0.0.1'], 'stanley')
    paramiko_runner._run_script_on_remote_host(paramiko_runner)
    exp_cmd = "cd /test/cwd/ && /tmp/shiz_storm.py 'blank space'"
    ParallelSSHClient.run.assert_called_with(exp_cmd, timeout=None)

dataset/ETHPy150Open StackStorm/st2/st2actions/tests/unit/test_paramiko_remote_script_runner.py ParamikoScriptRunnerTestCase.test_cwd_used_correctly/VarMisuse@169/326 `remote_action`->`paramiko_runner`