unit tests and fixes
This commit is contained in:
parent
821ed7b25e
commit
103dae6d08
@ -362,6 +362,15 @@ auto s3_provider::get_directory_items(const std::string &api_path,
|
|||||||
directory_item_list &list) const
|
directory_item_list &list) const
|
||||||
-> api_error {
|
-> api_error {
|
||||||
try {
|
try {
|
||||||
|
bool exists{};
|
||||||
|
auto res = is_directory(api_path, exists);
|
||||||
|
if (res != api_error::success) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
if (not exists) {
|
||||||
|
return api_error::directory_not_found;
|
||||||
|
}
|
||||||
|
|
||||||
const auto cfg = get_config().get_s3_config();
|
const auto cfg = get_config().get_s3_config();
|
||||||
const auto is_encrypted = not cfg.encryption_token.empty();
|
const auto is_encrypted = not cfg.encryption_token.empty();
|
||||||
std::string key;
|
std::string key;
|
||||||
|
@ -294,6 +294,7 @@ static void get_api_path_from_source(const app_config &cfg,
|
|||||||
provider.get_api_path_from_source(fsi.source_path, api_path));
|
provider.get_api_path_from_source(fsi.source_path, api_path));
|
||||||
|
|
||||||
EXPECT_STREQ("/pt01.txt", api_path.c_str());
|
EXPECT_STREQ("/pt01.txt", api_path.c_str());
|
||||||
|
EXPECT_EQ(api_error::success, provider.remove_file("/pt01.txt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user