"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/client/test_ssh.py" between
salt-3002.1.tar.gz and salt-3002.2.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

test_ssh.py  (salt-3002.1):test_ssh.py  (salt-3002.2)
skipping to change at line 390 skipping to change at line 390
exp_ret = ("Success", "", 0) exp_ret = ("Success", "", 0)
mock_cmd = MagicMock(return_value=exp_ret) mock_cmd = MagicMock(return_value=exp_ret)
patch_cmd = patch("salt.client.ssh.shell.Shell.exec_cmd", mock_cmd) patch_cmd = patch("salt.client.ssh.shell.Shell.exec_cmd", mock_cmd)
patch_send = patch("salt.client.ssh.shell.Shell.send", return_value=("", "", 0)) patch_send = patch("salt.client.ssh.shell.Shell.send", return_value=("", "", 0))
patch_rand = patch("os.urandom", return_value=b"5\xd9l\xca\xc2\xff") patch_rand = patch("os.urandom", return_value=b"5\xd9l\xca\xc2\xff")
with patch_cmd, patch_rand, patch_send: with patch_cmd, patch_rand, patch_send:
ret = single.shim_cmd(cmd_str="echo test") ret = single.shim_cmd(cmd_str="echo test")
assert ret == exp_ret assert ret == exp_ret
assert [ assert [
call("/bin/sh '$HOME/.35d96ccac2ff.py'"), call("/bin/sh '.35d96ccac2ff.py'"),
call("rm '$HOME/.35d96ccac2ff.py'"), call("rm '.35d96ccac2ff.py'"),
] == mock_cmd.call_args_list ] == mock_cmd.call_args_list
def test_run_ssh_pre_flight(self): def test_run_ssh_pre_flight(self):
""" """
test Single.run_ssh_pre_flight test Single.run_ssh_pre_flight
""" """
target = self.target.copy() target = self.target.copy()
target["ssh_pre_flight"] = os.path.join(RUNTIME_VARS.TMP, "script.sh") target["ssh_pre_flight"] = os.path.join(RUNTIME_VARS.TMP, "script.sh")
single = ssh.Single( single = ssh.Single(
self.opts, self.opts,
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)