def test_rsync_back_to_local(self, os_system): ssh = SSHCrossCloud(**self.command_arg) ssh.ssh_params.pem_ssh = "b" ssh.ssh_params.instance_user = "******" ssh.ssh_params.public_ip = "d" ssh.ssh_params.rsync_directory = "e" ssh.ssh_params.verbose = False ssh.rsync_to_instance() os_system.assert_called_with( "rsync -Pa -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o " "LogLevel=quiet b' --exclude-from='.rsyncignore' e/* c@d:/home/c") ssh.ssh_params.verbose = True ssh.rsync_to_instance() os_system.assert_called_with( "rsync -Pav -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o " "LogLevel=quiet b' --exclude-from='.rsyncignore' e/* c@d:/home/c")
def test_rsync_to_instance(self, os_system): ssh = SSHCrossCloud(**self.command_arg) ssh.ssh_params.ssh_fonctionnal_params = "a" ssh.ssh_params.pem_ssh = "b" ssh.ssh_params.instance_user = "******" ssh.ssh_params.public_ip = "d" ssh.ssh_params.rsync_directory = "e" ssh.ssh_params.verbose = False ssh.rsync_to_instance() os_system.assert_called_with( "rsync -Pa -e 'ssh a b' --exclude-from='.rsyncignore' e/* c@d:/home/c" ) ssh.ssh_params.verbose = True ssh.rsync_to_instance() os_system.assert_called_with( "rsync -Pav -e 'ssh a b' --exclude-from='.rsyncignore' e/* c@d:/home/c" )