| 268 CX_TEST_ASSERT(!dav_exists(res2)); |
268 CX_TEST_ASSERT(!dav_exists(res2)); |
| 269 |
269 |
| 270 dav_session_destroy(sn); |
270 dav_session_destroy(sn); |
| 271 } |
271 } |
| 272 } |
272 } |
| |
273 |
| |
274 CX_TEST(test_dav_copy_webdav) { |
| |
275 CX_TEST_DO { |
| |
276 DavSession *sn = get_test_webdav_session(); |
| |
277 |
| |
278 DavResource *res1 = dav_resource_new(sn, "/test_dav_copy_webdav.txt"); |
| |
279 CX_TEST_ASSERT(!dav_create(res1)); |
| |
280 |
| |
281 cxstring content = cx_str("Copy Test Data"); |
| |
282 dav_set_content_data(res1, content.ptr, content.length); |
| |
283 CX_TEST_ASSERT(!dav_store(res1)); |
| |
284 |
| |
285 DavResource *res2 = dav_resource_new(sn, "/test_dav_copy_webdav_dest.txt"); |
| |
286 CX_TEST_ASSERT(!dav_exists(res2)); |
| |
287 |
| |
288 CX_TEST_ASSERT(!dav_copy(res1, res2->path)); |
| |
289 CX_TEST_ASSERT(dav_exists(res2)); |
| |
290 CX_TEST_ASSERT(!dav_load(res2)); |
| |
291 // contentlength could be greater if encryption is enabled |
| |
292 CX_TEST_ASSERT(res2->contentlength >= content.length); |
| |
293 |
| |
294 dav_session_destroy(sn); |
| |
295 } |
| |
296 } |