[unit test] Complete all providers unit tests #12
This commit is contained in:
@@ -1204,6 +1204,8 @@ auto s3_provider::upload_file_impl(const std::string &api_path,
|
|||||||
return api_error::comm_error;
|
return api_error::comm_error;
|
||||||
}
|
}
|
||||||
file_size = opt_size.value();
|
file_size = opt_size.value();
|
||||||
|
} else {
|
||||||
|
return api_error::item_not_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto &cfg{get_s3_config()};
|
const auto &cfg{get_s3_config()};
|
||||||
|
@@ -900,6 +900,10 @@ auto sia_provider::upload_file_impl(const std::string &api_path,
|
|||||||
stop_type &stop_requested) -> api_error {
|
stop_type &stop_requested) -> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
|
if (not utils::file::file{source_path}.exists()) {
|
||||||
|
return api_error::item_not_found;
|
||||||
|
}
|
||||||
|
|
||||||
curl::requests::http_put_file put_file{};
|
curl::requests::http_put_file put_file{};
|
||||||
put_file.path = "/api/worker/object" + api_path;
|
put_file.path = "/api/worker/object" + api_path;
|
||||||
put_file.query["bucket"] = get_sia_config().bucket;
|
put_file.query["bucket"] = get_sia_config().bucket;
|
||||||
|
Reference in New Issue
Block a user