[unit test] Complete all providers unit tests #12
Some checks are pending
Blockstorage/repertory/pipeline/head Build queued...
Some checks are pending
Blockstorage/repertory/pipeline/head Build queued...
This commit is contained in:
@@ -1428,13 +1428,20 @@ static void remove_item_meta_path_not_found(i_provider &provider) {
|
|||||||
EXPECT_EQ(api_error::item_not_found, res);
|
EXPECT_EQ(api_error::item_not_found, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void remove_item_meta_restricted_names_fail(i_provider &provider) {
|
static void remove_item_meta_restricted_names_fail(const app_config &cfg,
|
||||||
|
i_provider &provider) {
|
||||||
fmt::println("testing|{}|{}",
|
fmt::println("testing|{}|{}",
|
||||||
app_config::get_provider_name(provider.get_provider_type()),
|
app_config::get_provider_name(provider.get_provider_type()),
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
|
|
||||||
std::string api_path{"/rim_restricted.txt"};
|
std::string api_path;
|
||||||
if (provider.get_provider_type() != provider_type::encrypt) {
|
if (provider.get_provider_type() == provider_type::encrypt) {
|
||||||
|
auto source_path =
|
||||||
|
utils::path::combine(cfg.get_encrypt_config().path, {"test.txt"});
|
||||||
|
EXPECT_EQ(api_error::success,
|
||||||
|
provider.get_api_path_from_source(source_path, api_path));
|
||||||
|
} else {
|
||||||
|
api_path = "/rim_restricted.txt";
|
||||||
create_file(provider, api_path);
|
create_file(provider, api_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1611,7 +1618,7 @@ static void run_tests(const app_config &cfg, i_provider &provider) {
|
|||||||
|
|
||||||
remove_item_meta(provider);
|
remove_item_meta(provider);
|
||||||
remove_item_meta_path_not_found(provider);
|
remove_item_meta_path_not_found(provider);
|
||||||
remove_item_meta_restricted_names_fail(provider);
|
remove_item_meta_restricted_names_fail(cfg, provider);
|
||||||
|
|
||||||
rename_file(provider);
|
rename_file(provider);
|
||||||
rename_file_fails_if_source_not_found(provider);
|
rename_file_fails_if_source_not_found(provider);
|
||||||
|
Reference in New Issue
Block a user