test/webdav_resource.c

branch
dav-2
changeset 912
4a51f896015e
parent 911
73f5a1a6dcf1
equal deleted inserted replaced
911:73f5a1a6dcf1 912:4a51f896015e
107 107
108 dav_session_destroy(sn); 108 dav_session_destroy(sn);
109 } 109 }
110 } 110 }
111 111
112 CX_TEST(test_dav_create_collection_webdav) {
113 CX_TEST_DO {
114 DavSession *sn = get_test_webdav_session();
115
116 DavResource *col1 = dav_resource_new(sn, "/test_create_collection1");
117 col1->iscollection = TRUE;
118 CX_TEST_ASSERT(!dav_exists(col1)); // the resource should not exist yet
119 CX_TEST_ASSERT(!dav_create(col1)); // create the resource
120 CX_TEST_ASSERT(dav_exists(col1)); // the resource should exist now
121
122 DavResource *col2 = dav_resource_new(sn, col1->path);
123 CX_TEST_ASSERT(dav_exists(col2));
124 CX_TEST_ASSERT(col2->iscollection);
125
126 dav_session_destroy(sn);
127 }
128 }
129
112 CX_TEST(test_dav_store_content_webdav) { 130 CX_TEST(test_dav_store_content_webdav) {
113 CX_TEST_DO { 131 CX_TEST_DO {
114 DavSession *sn = get_test_webdav_session(); 132 DavSession *sn = get_test_webdav_session();
115 DavResource *res = dav_resource_new(sn, "/test_store_content.txt"); 133 DavResource *res = dav_resource_new(sn, "/test_store_content.txt");
116 cxstring content = cx_str("test_store_content test content\n"); 134 cxstring content = cx_str("test_store_content test content\n");

mercurial