| 2067 | } |
| 2068 | |
| 2069 | void TestCreateContainerFromPath() { |
| 2070 | auto data = SetUpPreexistingData(); |
| 2071 | auto missing_path = data.RandomDirectoryPath(rng_); |
| 2072 | ASSERT_MOVE(missing_path, "new-container", ENOENT); |
| 2073 | EXPECT_RAISES_WITH_MESSAGE_THAT( |
| 2074 | Invalid, |
| 2075 | ::testing::HasSubstr("Creating files at '/' is not possible, only directories."), |
| 2076 | fs()->Move(data.ObjectPath(), "new-file")); |
| 2077 | auto src_dir_path = data.RandomDirectoryPath(rng_); |
| 2078 | ASSERT_OK(fs()->CreateDir(src_dir_path, false)); |
| 2079 | EXPECT_OK_AND_ASSIGN(auto src_dir_info, fs()->GetFileInfo(src_dir_path)); |
| 2080 | EXPECT_EQ(src_dir_info.type(), FileType::Directory); |
| 2081 | EXPECT_RAISES_WITH_MESSAGE_THAT( |
| 2082 | NotImplemented, |
| 2083 | HasCrossContainerNotImplementedMessage(src_dir_path, "new-container"), |
| 2084 | fs()->Move(src_dir_path, "new-container")); |
| 2085 | } |
| 2086 | |
| 2087 | void TestMovePath() { |
| 2088 | Status st; |
nothing calls this directly
no test coverage detected