|
@@ -108,6 +108,23 @@ static void beforeRestart() {
|
|
|
"a path as the project: InvalidArgument, invalid_project, got '" + d2.reason + "'");
|
|
"a path as the project: InvalidArgument, invalid_project, got '" + d2.reason + "'");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // ---- after 2.21.7: listFiles carries the metadata map, as getFileInfo does
|
|
|
|
|
+ {
|
|
|
|
|
+ auto m = meta("aliased.bin");
|
|
|
|
|
+ m.metadata["path"] = "/img/logo.png";
|
|
|
|
|
+ m.metadata["owner"] = "web";
|
|
|
|
|
+ auto up = c.uploadFile(bytes(100, 6), m);
|
|
|
|
|
+ auto listed = c.listFiles("", "", 100, 0, "", "aliased.bin");
|
|
|
|
|
+ ck(listed.files.size() == 1 &&
|
|
|
|
|
+ listed.files[0].metadata.size() == 2 &&
|
|
|
|
|
+ listed.files[0].metadata.count("path") &&
|
|
|
|
|
+ listed.files[0].metadata.at("path") == "/img/logo.png",
|
|
|
|
|
+ "listFiles returns the stored metadata map");
|
|
|
|
|
+ auto info = c.getFileInfo(up.id);
|
|
|
|
|
+ ck(info && info->metadata.count("owner") && info->metadata.at("owner") == "web",
|
|
|
|
|
+ "getFileInfo returns the same metadata");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// ---- dropProject deletes the project's files, not shared content
|
|
// ---- dropProject deletes the project's files, not shared content
|
|
|
Client admin({.address = ADDR, .project = "default"});
|
|
Client admin({.address = ADDR, .project = "default"});
|
|
|
admin.connect();
|
|
admin.connect();
|