From 2cae947d228dbd6ddf441ed87a722fd98ccaa04e Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Thu, 18 Sep 2025 17:53:36 -0500 Subject: [PATCH] [unit test] Complete all providers unit tests #12 --- repertory/librepertory/src/providers/s3/s3_provider.cpp | 2 -- repertory/librepertory/src/providers/sia/sia_provider.cpp | 4 ---- repertory/repertory_test/src/providers_test.cpp | 5 +++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/repertory/librepertory/src/providers/s3/s3_provider.cpp b/repertory/librepertory/src/providers/s3/s3_provider.cpp index 82703539..187ce69c 100644 --- a/repertory/librepertory/src/providers/s3/s3_provider.cpp +++ b/repertory/librepertory/src/providers/s3/s3_provider.cpp @@ -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()}; diff --git a/repertory/librepertory/src/providers/sia/sia_provider.cpp b/repertory/librepertory/src/providers/sia/sia_provider.cpp index 87eae75d..3909c255 100644 --- a/repertory/librepertory/src/providers/sia/sia_provider.cpp +++ b/repertory/librepertory/src/providers/sia/sia_provider.cpp @@ -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; diff --git a/repertory/repertory_test/src/providers_test.cpp b/repertory/repertory_test/src/providers_test.cpp index fe66c98b..5a5f9e89 100644 --- a/repertory/repertory_test/src/providers_test.cpp +++ b/repertory/repertory_test/src/providers_test.cpp @@ -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; }