diff options
author | Ryo Nakamura <upa@haeena.net> | 2024-01-11 10:06:12 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2024-01-18 12:59:49 +0900 |
commit | 4b34118a88be403e8028806ba09be41212d289b1 (patch) | |
tree | 157fd601b4dde020340beb46c59272de5881c5b5 | |
parent | 68a8f3724fb742a3c3773a5c5300def5ec4e7c1a (diff) |
add a test case test_copy_file_under_root_to_dir
Coping a file under / (root) to a remote directory causes
corrupted remote path (Issue #8).
-rw-r--r-- | test/test_e2e.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_e2e.py b/test/test_e2e.py index 4332f6c..b6ed73d 100644 --- a/test/test_e2e.py +++ b/test/test_e2e.py @@ -203,6 +203,22 @@ def test_override_single_file(mscp, src_prefix, dst_prefix): src.cleanup() dst.cleanup() +absolute_remote_prefix = "localhost:" +param_absolute_remote_prefix = [ + ("", absolute_remote_prefix), (absolute_remote_prefix, "") +] +@pytest.mark.parametrize("src_prefix, dst_prefix", param_absolute_remote_prefix) +def test_copy_file_under_root_to_dir(mscp, src_prefix, dst_prefix): + src = File("/mscp-test-src", size = 1024).make() + dst = File("/tmp/mscp-test-src") + + run2ok([mscp, "-H", "-vvv", src_prefix + src.path, + dst_prefix + os.path.dirname(dst.path)]) + assert check_same_md5sum(src, dst) + src.cleanup() + dst.cleanup() + + @pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix) def test_min_chunk(mscp, src_prefix, dst_prefix): src = File("src", size = 16 * 1024).make() |