| | 39 | TEST_ROOT = "/home/schwa/sd/python/ftputil" |
| | 40 | sys.path.insert(0, os.path.dirname(TEST_ROOT)) |
| | 41 | |
| | 42 | from ftputil import ftp_sync |
| | 43 | |
| | 44 | |
| | 45 | class TestLocalToLocal(unittest.TestCase): |
| | 46 | def setUp(self): |
| | 47 | target_dir = os.path.join(TEST_ROOT, "test_target") |
| | 48 | shutil.rmtree(target_dir) |
| | 49 | os.mkdir(target_dir) |
| | 50 | |
| | 51 | def test_sync_empty_dir(self): |
| | 52 | source = ftp_sync.LocalHost() |
| | 53 | target = ftp_sync.LocalHost() |
| | 54 | syncer = ftp_sync.Syncer(source, target) |
| | 55 | source_dir = os.path.join(TEST_ROOT, "test_empty") |
| | 56 | target_dir = os.path.join(TEST_ROOT, "test_target") |
| | 57 | syncer.sync(source_dir, target_dir) |
| | 58 | |
| | 59 | |
| | 60 | if __name__ == '__main__': |
| | 61 | unittest.main() |
| | 62 | |