WebDAV COPY/MOVE tests

This commit is contained in:
mdecimus
2025-05-01 16:35:07 +02:00
parent 91944162d9
commit 5416e35d4d
28 changed files with 1600 additions and 363 deletions

View File

@@ -515,14 +515,6 @@ impl DavResources {
.filter(move |item| item.parent_id.is_some_and(|id| id == parent_id))
}
pub fn is_ancestor_of(&self, ancestor: u32, descendant: u32) -> bool {
let ancestor = &self.paths.by_id(ancestor).unwrap().name;
let descendant = &self.paths.by_id(descendant).unwrap().name;
let prefix = format!("{ancestor}/");
descendant.starts_with(&prefix) || descendant == ancestor
}
pub fn format_resource(&self, resource: &DavResource) -> String {
if resource.is_container() {
format!("{}{}/", self.base_path, resource.name)