Skip to content

Commit

Permalink
adds simple test for ssh wrapper in combination with rsync
Browse files Browse the repository at this point in the history
  • Loading branch information
tadly committed Aug 20, 2018
1 parent 639e11f commit 45b45db
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_rsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import shutil
import unittest

from dups import rsync
from dups import helper, rsync, const

import utils as test_utils

Expand Down Expand Up @@ -129,6 +129,18 @@ def test_options(self):
synced_data = test_utils.get_dir_struct(self.real_target)
self.assertEqual(expected_data, synced_data)

def test_ssh_wrapper(self):
sync = rsync.rsync()
sync.ssh_bin = '{} root {}'.format(const.SSH_WRAPPER_SCRIPT,
sync.ssh_bin)
sync.dry_run = False

# Send the files
target = rsync.Path(context.TMP_DIR, context.SSH_HOST)
status = sync.sync(target, [context.DATA_DIR])

self.assertEqual(status.exit_code, 0)


if __name__ == '__main__':
unittest.main(exit=False)

0 comments on commit 45b45db

Please sign in to comment.