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:1341:    string file2 = Stdio.append_path(testcase_dir, "file2.txt");    webdav_put(file1, "Content 1", STATUS_CREATED);    webdav_put(file2, "Content 2", STATUS_CREATED);    mapping(string:string) locks = ([]);    webdav_lock(file2, locks, STATUS_OK);    WebDAVResponse res = webdav_request(method, file1,    ([ "new-uri": file2 ]) + headers);    ASSERT_EQUAL(res->status, STATUS_LOCKED);    verify_lock_token(res);    current_locks = locks; -  res = ASSERT_CALL(webdav_request, method, file1, +  res = webdav_request(method, file1,    ([ "new-uri": file2 ]) + headers);    ASSERT_EQUAL(res->status, STATUS_NO_CONTENT);    ASSERT_TRUE(filesystem_compare_files, file1, file2);    ASSERT_TRUE(filesystem_check_content, file2, "Content 1");    if (method == "COPY") {    webdav_ls(testcase_dir,    ({ testcase_dir,    file1,    file2 }));    } else { // method == "MOVE"
Roxen.git/server/etc/test/modules/TEST.pmod/http.pmod/WebDAV.pmod/TestBase.pike:1416:    headers = ([ "Overwrite" : overwrite ]);    }    // Copy dir to file    string dir = Stdio.append_path(testcase_dir, "mydir");    string file = Stdio.append_path(testcase_dir, "myfile.txt");    webdav_mkcol(dir, STATUS_CREATED);    webdav_put(file, "My content", STATUS_CREATED);    ASSERT_CALL_TRUE(filesystem_is_file, file);    ASSERT_CALL_FALSE(filesystem_is_dir, file);    mapping(string:string) locks = ([]); -  ASSERT_CALL(webdav_lock, file, locks, STATUS_OK); +  webdav_lock(file, locks, STATUS_OK);    WebDAVResponse res = webdav_request(method, dir,    ([ "new-uri": file ]) + headers);    ASSERT_EQUAL(res->status, STATUS_LOCKED);    verify_lock_token(res);    current_locks = locks + ([]);    res = webdav_request(method, dir,    ([ "new-uri": file ]) + headers);    ASSERT_EQUAL(res->status, STATUS_NO_CONTENT);    ASSERT_CALL_TRUE(filesystem_is_dir, file);    ASSERT_CALL_FALSE(filesystem_is_file, file);
Roxen.git/server/etc/test/modules/TEST.pmod/http.pmod/WebDAV.pmod/TestBase.pike:1535:    string dst_file1 = Stdio.append_path(dst_dir, "file1.txt");    string dst_file2 = Stdio.append_path(dst_dir, "file2.txt");    webdav_mkcol(src_dir, STATUS_CREATED);    webdav_mkcol(dst_dir, STATUS_CREATED);    webdav_put(src_file1, "file1 in dir1", STATUS_CREATED);    webdav_put(src_file2, "file2 in dir1", STATUS_CREATED);    webdav_put(dst_file1, "file1 in dir2", STATUS_CREATED);    webdav_put(dst_file2, "file2 in dir2", STATUS_CREATED);    webdav_lock(dst_file2, ([]), STATUS_OK);    if (method == "COPY") { -  WebDAVResponse res = ASSERT_CALL(webdav_copy, src_dir, dst_dir, +  WebDAVResponse res = webdav_copy(src_dir, dst_dir,    STATUS_MULTI_STATUS);    verify_multistatus_response_when_resource_locked(res, ({ dst_file2 }));    } else { -  WebDAVResponse res = ASSERT_CALL(webdav_move, src_dir, dst_dir, +  WebDAVResponse 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.    webdav_ls(this::testcase_dir,    ({ this::testcase_dir,    src_dir,    src_file1,
Roxen.git/server/etc/test/modules/TEST.pmod/http.pmod/WebDAV.pmod/TestBase.pike:1571:    string dst_dir = Stdio.append_path(this::testcase_dir, "B");    string src_file1 = Stdio.append_path(src_dir, "file1.txt");    string src_file2 = Stdio.append_path(src_dir, "file2.txt");    string dst_file1 = Stdio.append_path(dst_dir, "file1.txt");    string dst_file2 = Stdio.append_path(dst_dir, "file2.txt");    webdav_mkcol(src_dir, STATUS_CREATED);    webdav_put(src_file1, "file1 in dir1", STATUS_CREATED);    webdav_put(src_file2, "file2 in dir1", STATUS_CREATED);    webdav_lock(dst_file2, ([]), STATUS_OK);    if (method == "COPY") { -  WebDAVResponse res = ASSERT_CALL(webdav_copy, src_dir, dst_dir, +  WebDAVResponse res = webdav_copy(src_dir, dst_dir,    STATUS_MULTI_STATUS);    verify_multistatus_response_when_resource_locked(res, ({ dst_file2 }));    } else { -  WebDAVResponse res = ASSERT_CALL(webdav_move, src_dir, dst_dir, +  WebDAVResponse 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    // move.    if (method == "COPY") {    webdav_ls(this::testcase_dir,    ({ this::testcase_dir,
Roxen.git/server/etc/test/modules/TEST.pmod/http.pmod/WebDAV.pmod/TestBase.pike:2054:    safely omitted because the client will know that the progeny of a    resource could not be moved when the client receives an error for the    parent. Additionally, 201 (Created)/204 (No Content) responses    SHOULD NOT be returned as values in 207 (Multi-Status) responses from    a MOVE. These responses can be safely omitted because they are the    default success codes.       For copy/move test where destination exists and is a directory,    Test both with an empty destination directory and with a non empty    destination directory. (We already test at least one of the cases.) -  -  Hmm, would it be better to remove all use of 'ASSERT_CALL'? Easier to -  understand errors in log? Or good as is? +    */         // -----------------------------------------------------------------------------   // Special testcases combining different encodings and mixed/lower/upper case   // letters.   // -----------------------------------------------------------------------------      #ifdef WEBDAV_TEST_ASCII_ONLY   protected constant FILENAMES =