Branch: Tag:

2018-04-03

2018-04-03 13:12:26 by Karl Gustav Sterneberg <kg@roxen.com>

Testsuite [WebDAV]: Removed some duplicated code.

1541:    webdav_put(dst_file1, "file1 in dir2", STATUS_CREATED);    webdav_put(dst_file2, "file2 in dir2", STATUS_CREATED);    webdav_lock(dst_file2, ([]), STATUS_OK); +  WebDAVResponse res;    if (method == "COPY") { -  WebDAVResponse res = webdav_copy(src_dir, dst_dir, -  STATUS_MULTI_STATUS); -  verify_multistatus_response_when_resource_locked(res, ({ dst_file2 })); +  res = webdav_copy(src_dir, dst_dir, STATUS_MULTI_STATUS);    } else { -  WebDAVResponse res = webdav_move(src_dir, dst_dir, -  ([]), STATUS_MULTI_STATUS); -  verify_multistatus_response_when_resource_locked(res, ({ dst_file2 })); +  res = webdav_move(src_dir, dst_dir, ([]), STATUS_MULTI_STATUS);    } -  +  verify_multistatus_response_when_resource_locked(res, ({ dst_file2 }));    // The destination directory has been wiped, except for dst_file2,    // which was locked.    // No actual delete, copy or move was performed.
1577:    webdav_put(src_file1, "file1 in dir1", STATUS_CREATED);    webdav_put(src_file2, "file2 in dir1", STATUS_CREATED);    webdav_lock(dst_file2, ([]), STATUS_OK); +  WebDAVResponse res;    if (method == "COPY") { -  WebDAVResponse res = webdav_copy(src_dir, dst_dir, -  STATUS_MULTI_STATUS); -  verify_multistatus_response_when_resource_locked(res, ({ dst_file2 })); +  res = webdav_copy(src_dir, dst_dir, STATUS_MULTI_STATUS);    } else { -  WebDAVResponse res = webdav_move(src_dir, dst_dir, -  ([]), STATUS_MULTI_STATUS); -  verify_multistatus_response_when_resource_locked(res, ({ dst_file2 })); +  res = webdav_move(src_dir, dst_dir, ([]), STATUS_MULTI_STATUS);    } -  +  verify_multistatus_response_when_resource_locked(res, ({ dst_file2 }));    // dst_file1 should have been overwritten by src_file1.    // the path dst_file2 was locked so it should not have been copied.    // src_file2 with same as dst_file2 should not have been moved if this was a