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='******', user='******',
         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(remote_action)
     exp_cmd = "cd /test/cwd/ && /tmp/shiz_storm.py 'blank space'"
     ParallelSSHClient.run.assert_called_with(exp_cmd,
                                              timeout=None)
 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='******', user='******',
         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(remote_action)
     exp_cmd = "cd /test/cwd/ && /tmp/shiz_storm.py 'blank space'"
     ParallelSSHClient.run.assert_called_with(exp_cmd,
                                              timeout=None)
 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="******",
         user="******",
         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(remote_action)
     exp_cmd = "cd /test/cwd/ && /tmp/shiz_storm.py 'blank space'"
     ParallelSSHClient.run.assert_called_with(exp_cmd, timeout=None)