removed test
This commit is contained in:
parent
ca892c7f11
commit
0089866142
@ -1661,60 +1661,6 @@ TEST(file_manager, can_queue_and_remove_upload) {
|
|||||||
EXPECT_TRUE(utils::file::directory(file_manager_dir).remove_recursively());
|
EXPECT_TRUE(utils::file::directory(file_manager_dir).remove_recursively());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(file_manager, remove_file_fails_if_open_file_is_modified) {
|
|
||||||
EXPECT_TRUE(utils::file::directory(file_manager_dir).remove_recursively());
|
|
||||||
|
|
||||||
{
|
|
||||||
app_config cfg(provider_type::sia, file_manager_dir);
|
|
||||||
cfg.set_enable_chunk_downloader_timeout(false);
|
|
||||||
mock_provider mp;
|
|
||||||
|
|
||||||
EXPECT_CALL(mp, is_direct_only()).WillRepeatedly(Return(false));
|
|
||||||
|
|
||||||
file_manager fm(cfg, mp);
|
|
||||||
|
|
||||||
auto of = std::make_shared<mock_open_file>();
|
|
||||||
EXPECT_CALL(*of, add).WillOnce(Return());
|
|
||||||
EXPECT_CALL(*of, get_api_path).WillRepeatedly(Return("/test_remove.txt"));
|
|
||||||
EXPECT_CALL(*of, get_source_path).WillRepeatedly(Return(""));
|
|
||||||
EXPECT_CALL(*of, is_modified).WillOnce(Return(true));
|
|
||||||
EXPECT_CALL(*of, is_directory).WillOnce(Return(false));
|
|
||||||
|
|
||||||
EXPECT_CALL(mp, get_filesystem_item)
|
|
||||||
.WillOnce([](const std::string &api_path, bool directory,
|
|
||||||
filesystem_item &fsi) -> api_error {
|
|
||||||
EXPECT_STREQ("/test_remove.txt", api_path.c_str());
|
|
||||||
EXPECT_FALSE(directory);
|
|
||||||
fsi.api_path = api_path;
|
|
||||||
fsi.api_parent = utils::path::get_parent_api_path(api_path);
|
|
||||||
fsi.directory = directory;
|
|
||||||
fsi.size = 0U;
|
|
||||||
return api_error::success;
|
|
||||||
});
|
|
||||||
|
|
||||||
EXPECT_CALL(mp, set_item_meta(_, _, _))
|
|
||||||
.WillOnce([](const std::string &api_path, const std::string &key,
|
|
||||||
const std::string &value) -> api_error {
|
|
||||||
EXPECT_STREQ("/test_remove.txt", api_path.c_str());
|
|
||||||
EXPECT_STREQ(META_SOURCE.c_str(), key.c_str());
|
|
||||||
EXPECT_FALSE(value.empty());
|
|
||||||
return api_error::success;
|
|
||||||
});
|
|
||||||
|
|
||||||
std::uint64_t handle{};
|
|
||||||
std::shared_ptr<i_open_file> f{};
|
|
||||||
#if defined(_WIN32)
|
|
||||||
EXPECT_EQ(api_error::success, fm.open(of, {}, handle, f));
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(api_error::success, fm.open(of, O_RDWR, handle, f));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EXPECT_EQ(api_error::file_in_use, fm.remove_file("/test_remove.txt"));
|
|
||||||
}
|
|
||||||
|
|
||||||
EXPECT_TRUE(utils::file::directory(file_manager_dir).remove_recursively());
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(file_manager, file_is_closed_after_download_timeout) {
|
TEST(file_manager, file_is_closed_after_download_timeout) {
|
||||||
{
|
{
|
||||||
console_consumer c;
|
console_consumer c;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user