Roxen.git / server / etc / test / modules / TEST.pmod / http.pmod / WebDAV.pmod / TestBase.pike

version» Context lines:

Roxen.git/server/etc/test/modules/TEST.pmod/http.pmod/WebDAV.pmod/TestBase.pike:550:    }    if (apply_string_to_utf8) {    filenames = map(filenames, string_to_utf8);    }    // NB: We do not want to encode dir in any way. Should be as given.    return map(filenames, lambda(string filename) {    return Stdio.append_path(dir, filename);    });   }    - protected void verify_lock_token(WebDAVResponse res) { -  ASSERT_EQUAL(res->status, STATUS_LOCKED); + protected void verify_lock_token(WebDAVResponse res) + { +  ASSERT_TRUE((res->status == STATUS_LOCKED) || +  (res->status == STATUS_MULTI_STATUS));    // TODO: Parse data and verify response contains the    // 'lock-token-submitted' precondition element and that is looks as expected.    ASSERT_CALL_TRUE(has_value, res->data, "lock-token-submitted");   }      protected void verify_multistatus_response_when_resource_locked(    WebDAVResponse res,    array(string) locked_files)   {    ASSERT_EQUAL(res->status, STATUS_MULTI_STATUS);
Roxen.git/server/etc/test/modules/TEST.pmod/http.pmod/WebDAV.pmod/TestBase.pike:1906:    string src_parent = Stdio.append_path(this::testcase_dir, "parent");    string src = Stdio.append_path(src_parent, "src");    string child = Stdio.append_path(src, "child");    string dst = Stdio.append_path(this::testcase_dir, "dst");    webdav_mkcol(src_parent, STATUS_CREATED);    webdav_mkcol(src, STATUS_CREATED);    webdav_put(child, "Child content", STATUS_CREATED);    foreach (({src_parent, src, child}), string resource_to_lock) {    mapping(string:string) locks = ([]);    webdav_lock(resource_to_lock, locks, STATUS_OK); -  WebDAVResponse res = webdav_move(src, dst, ([]), STATUS_LOCKED); +  WebDAVResponse res = webdav_move(src, dst, ([]), +  (resource_to_lock == child) ? +  STATUS_MULTI_STATUS: STATUS_LOCKED);    verify_lock_token(res);    webdav_unlock(resource_to_lock, locks, STATUS_NO_CONTENT);    }    WebDAVResponse res = webdav_move(src, dst, ([]), STATUS_CREATED);    webdav_ls(this::testcase_dir,    ({ this::testcase_dir,    src_parent,    dst,    Stdio.append_path(dst, "child") }));   }
Roxen.git/server/etc/test/modules/TEST.pmod/http.pmod/WebDAV.pmod/TestBase.pike:1938:    string dst = Stdio.append_path(dst_parent, "dst");    string dst_child = Stdio.append_path(dst, child_name); // Must be same name as src child!    foreach (({src, dst_parent, dst}), string col) {    webdav_mkcol(col, STATUS_CREATED);    }    webdav_put(src_child, "src child content", STATUS_CREATED);    webdav_put(dst_child, "dst child content", STATUS_CREATED);    foreach (({dst_parent, dst, dst_child}), string resource_to_lock) {    mapping(string:string) locks = ([]);    webdav_lock(resource_to_lock, locks, STATUS_OK); -  WebDAVResponse res = webdav_move(src, dst, ([]), STATUS_LOCKED); +  WebDAVResponse res = webdav_move(src, dst, ([]), +  (resource_to_lock == dst_child) ? +  STATUS_MULTI_STATUS:STATUS_LOCKED);    verify_lock_token(res);    webdav_unlock(resource_to_lock, locks, STATUS_NO_CONTENT);    }    WebDAVResponse res = webdav_move(src, dst, ([]), STATUS_NO_CONTENT);    filesystem_check_content(dst_child, "src child content");    webdav_ls(this::testcase_dir,    ({ this::testcase_dir,    dst_parent,    dst,    dst_child }));