kou commented on code in PR #39840:
URL: https://github.com/apache/arrow/pull/39840#discussion_r1482353815


##########
cpp/src/arrow/filesystem/azurefs_test.cc:
##########
@@ -1382,6 +1382,38 @@ TEST_F(TestAzuriteFileSystem, 
DeleteDirContentsFailureNonexistent) {
   this->TestDeleteDirContentsFailureNonexistent();
 }
 
+TEST_F(TestAzuriteFileSystem, DeleteFileSuccess) {
+  const auto container_name = PreexistingData::RandomContainerName(rng_);
+  ASSERT_OK(fs()->CreateDir(container_name));
+  const auto file_name = ConcatAbstractPath(container_name, "abc");
+  CreateFile(fs(), file_name, "data");
+  arrow::fs::AssertFileInfo(fs(), file_name, FileType::File);
+  ASSERT_OK(fs()->DeleteFile(file_name));
+  arrow::fs::AssertFileInfo(fs(), file_name, FileType::NotFound);
+}
+
+TEST_F(TestAzuriteFileSystem, DeleteFileFailureNonexistent) {
+  const auto container_name = PreexistingData::RandomContainerName(rng_);
+  auto container_client = CreateContainer(container_name);
+  const auto blob_path = ConcatAbstractPath(container_name, "someblob");
+  ASSERT_RAISES(IOError, fs()->DeleteFile(blob_path));

Review Comment:
   I don't have strong opinion which API should be used here but could you use 
the same style for `DeleteFileSuccess` and `DeleteFileFalureNonexistent`? For 
example, the following change uses Filesystem API like `DeleteFileSuccess`:
   
   ```suggestion
     const auto container_name = PreexistingData::RandomContainerName(rng_);
     ASSERT_OK(fs()->CreateDir(container_name));
     const auto nonexistent_file_name = ConcatAbstractPath(container_name, 
"nonexistent");
     ASSERT_RAISES(IOError, fs()->DeleteFile(nonexistent_file_name));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to