Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cpp/src/arrow/filesystem/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,9 @@ void GenericFileSystemTest::TestOpenInputStream(FileSystem* fs) {
ASSERT_RAISES(IOError, fs->OpenInputStream("def"));

// Cannot open directory
ASSERT_RAISES(IOError, fs->OpenInputStream("AB"));
if (!allow_read_dir_as_file()) {
ASSERT_RAISES(IOError, fs->OpenInputStream("AB"));
}
}

void GenericFileSystemTest::TestOpenInputStreamWithFileInfo(FileSystem* fs) {
Expand Down Expand Up @@ -1029,7 +1031,9 @@ void GenericFileSystemTest::TestOpenInputFile(FileSystem* fs) {
ASSERT_RAISES(IOError, fs->OpenInputFile("def"));

// Cannot open directory
ASSERT_RAISES(IOError, fs->OpenInputFile("AB"));
if (!allow_read_dir_as_file()) {
ASSERT_RAISES(IOError, fs->OpenInputFile("AB"));
}
}

void GenericFileSystemTest::TestOpenInputFileAsync(FileSystem* fs) {
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/arrow/filesystem/test_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ class ARROW_TESTING_EXPORT GenericFileSystemTest {
virtual bool have_implicit_directories() const { return false; }
// - Whether the filesystem may allow writing a file "over" a directory
virtual bool allow_write_file_over_dir() const { return false; }
// - Whether the filesystem allows reading a directory
virtual bool allow_read_dir_as_file() const { return false; }
// - Whether the filesystem allows moving a directory
virtual bool allow_move_dir() const { return true; }
// - Whether the filesystem allows moving a directory "over" a non-empty destination
Expand Down