Skip to content

Commit

Permalink
Add test DisallowCreatingFileAndDirectoryWithTheSameName
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Newton committed Feb 18, 2024
1 parent 67a5e20 commit 5388f67
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cpp/src/arrow/filesystem/azurefs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,18 @@ class TestAzureFileSystem : public ::testing::Test {
ASSERT_RAISES(IOError, fs()->OpenInputFile(directory_path));
}

void TestDisallowCreatingFileAndDirectoryWithTheSameName() {
auto data = SetUpPreexistingData();
auto path1 = data.Path("directory1");
ASSERT_OK(fs()->CreateDir(path1));
ASSERT_RAISES(IOError, fs()->OpenOutputStream(path1));
ASSERT_RAISES(IOError, fs()->OpenAppendStream(path1));

auto path2 = data.Path("directory2");
ASSERT_OK(fs()->OpenOutputStream(path2));
ASSERT_RAISES(IOError, fs()->CreateDir(path2));
}

void TestDeleteDirSuccessEmpty() {
if (HasSubmitBatchBug()) {
GTEST_SKIP() << kSubmitBatchBugMessage;
Expand Down Expand Up @@ -1571,6 +1583,10 @@ TYPED_TEST(TestAzureFileSystemOnAllScenarios, DisallowReadingOrWritingDirectoryM
this->TestDisallowReadingOrWritingDirectoryMarkers();
}

TYPED_TEST(TestAzureFileSystemOnAllScenarios, DisallowCreatingFileAndDirectoryWithTheSameName) {
this->TestDisallowCreatingFileAndDirectoryWithTheSameName();
}

TYPED_TEST(TestAzureFileSystemOnAllScenarios, DeleteDirSuccessEmpty) {
this->TestDeleteDirSuccessEmpty();
}
Expand Down

0 comments on commit 5388f67

Please sign in to comment.