From 41427331e0715a150cde7b9638fe236756e69117 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Wed, 1 Nov 2023 20:24:14 +0000 Subject: [PATCH] Test empty directory on HNS account --- cpp/src/arrow/filesystem/azurefs_test.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cpp/src/arrow/filesystem/azurefs_test.cc b/cpp/src/arrow/filesystem/azurefs_test.cc index 41adf1e163697..60bb6a8c2132d 100644 --- a/cpp/src/arrow/filesystem/azurefs_test.cc +++ b/cpp/src/arrow/filesystem/azurefs_test.cc @@ -321,6 +321,10 @@ TEST_F(TestAzureHNSFileSystem, GetFileInfoObjectWithNestedStructure) { .GetBlockBlobClient(std::string(kObjectName) + "0") .UploadFrom(reinterpret_cast(kLoremIpsum), strlen(kLoremIpsum)); + datalake_service_client_->GetFileSystemClient(PreexistingContainerName()) + .GetDirectoryClient("test-empty-object-dir") + .Create(); + AssertFileInfo(fs_.get(), PreexistingContainerPath() + kObjectName, FileType::File); AssertFileInfo(fs_.get(), PreexistingContainerPath() + kObjectName + "/", FileType::NotFound); @@ -338,6 +342,11 @@ TEST_F(TestAzureHNSFileSystem, GetFileInfoObjectWithNestedStructure) { FileType::NotFound); AssertFileInfo(fs_.get(), PreexistingContainerPath() + "test-object-dir/some_other_di", FileType::NotFound); + + AssertFileInfo(fs_.get(), PreexistingContainerPath() + "test-empty-object-dir", + FileType::Directory); + + // TODO: Add an assert that it did not use ListBlobs to detect directories. } // TODO: Add ADLS Gen2 directory tests.