| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
import time |
| 10 |
|
| 11 |
from rsyncfns import ( |
| 12 |
FROMDIR, SRCDIR, TODIR, cp_p, cp_touch, run_rsync, test_fail, verify_dirs, |
| 13 |
) |
| 14 |
|
| 15 |
|
| 16 |
FROMDIR.mkdir(parents=True, exist_ok=True) |
| 17 |
TODIR.mkdir(parents=True, exist_ok=True) |
| 18 |
|
| 19 |
cp_p(SRCDIR / 'rsync.c', FROMDIR / 'rsync.c') |
| 20 |
cp_touch(FROMDIR / 'rsync.c', TODIR / 'rsync2.c') |
| 21 |
time.sleep(1) |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
proc = run_rsync('-avvi', '--no-whole-file', '--fuzzy', '--delete-delay', |
| 28 |
'--debug=FUZZY', f'{FROMDIR}/', f'{TODIR}/', |
| 29 |
capture_output=True) |
| 30 |
if 'fuzzy basis selected for rsync.c: rsync2.c' not in proc.stdout: |
| 31 |
test_fail("--fuzzy did not select rsync2.c as the basis for rsync.c; " |
| 32 |
f"--debug=FUZZY output was:\n{proc.stdout}") |
| 33 |
|
| 34 |
verify_dirs(FROMDIR, TODIR) |