[unit test] Complete all providers unit tests #12

This commit is contained in:
2025-09-18 17:53:36 -05:00
parent 1fbdf19269
commit 2cae947d22
3 changed files with 3 additions and 8 deletions

View File

@@ -1204,8 +1204,6 @@ auto s3_provider::upload_file_impl(const std::string &api_path,
return api_error::comm_error;
}
file_size = opt_size.value();
} else {
return api_error::item_not_found;
}
const auto &cfg{get_s3_config()};

View File

@@ -900,10 +900,6 @@ auto sia_provider::upload_file_impl(const std::string &api_path,
stop_type &stop_requested) -> api_error {
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{};
put_file.path = "/api/worker/object" + api_path;
put_file.query["bucket"] = get_sia_config().bucket;

View File

@@ -1263,10 +1263,11 @@ TYPED_TEST(providers_test, upload_file_fails_if_source_not_found) {
stop_type stop_requested{false};
auto res = this->provider->upload_file(
"/no_src_upload.txt", "/path/does/not/exist.bin", stop_requested);
EXPECT_EQ(api_error::item_not_found, res);
EXPECT_NE(res, api_error::success);
}
TYPED_TEST(providers_test, is_file_is_directory_cross_checks) {
TYPED_TEST(providers_test,
file_is_not_a_directory_and_a_directory_is_not_a_file) {
if (this->provider->is_read_only()) {
return;
}