felipecrv commented on code in PR #39207:
URL: https://github.com/apache/arrow/pull/39207#discussion_r1425875580
##########
cpp/src/arrow/filesystem/azurefs_test.cc:
##########
@@ -254,54 +398,20 @@ class AzureFileSystemTest : public ::testing::Test {
return blob_client;
}
- std::string PreexistingContainerName() const { return container_name_; }
-
- std::string PreexistingContainerPath() const {
- return PreexistingContainerName() + '/';
- }
-
- static std::string PreexistingObjectName() { return "test-object-name"; }
-
- std::string PreexistingObjectPath() const {
- return PreexistingContainerPath() + PreexistingObjectName();
- }
-
- std::string NotFoundObjectPath() { return PreexistingContainerPath() +
"not-found"; }
-
- std::string RandomLine(int lineno, std::size_t width) {
- auto line = std::to_string(lineno) + ": ";
- line += RandomChars(width - line.size() - 1);
- line += '\n';
- return line;
- }
-
- std::size_t RandomIndex(std::size_t end) {
- return std::uniform_int_distribution<std::size_t>(0, end - 1)(generator_);
- }
-
- std::string RandomChars(std::size_t count) {
- auto const fillers = std::string("abcdefghijlkmnopqrstuvwxyz0123456789");
- std::uniform_int_distribution<std::size_t> d(0, fillers.size() - 1);
- std::string s;
- std::generate_n(std::back_inserter(s), count, [&] { return
fillers[d(generator_)]; });
- return s;
- }
-
- std::string RandomContainerName() { return RandomChars(32); }
-
- std::string RandomDirectoryName() { return RandomChars(32); }
-
- void UploadLines(const std::vector<std::string>& lines, const char*
path_to_file,
+ void UploadLines(const std::vector<std::string>& lines, const std::string&
path,
int total_size) {
- const auto path = PreexistingContainerPath() + path_to_file;
ASSERT_OK_AND_ASSIGN(auto output, fs_->OpenOutputStream(path, {}));
const auto all_lines = std::accumulate(lines.begin(), lines.end(),
std::string(""));
ASSERT_OK(output->Write(all_lines));
ASSERT_OK(output->Close());
}
- void RunGetFileInfoObjectWithNestedStructureTest();
- void RunGetFileInfoObjectTest();
+ PreexistingData SetUpPreexistingData() {
+ PreexistingData data(rng_);
+ auto container_client = CreateContainer(data.container_name);
+ CreateBlob(container_client, data.kObjectName,
PreexistingData::kLoremIpsum);
Review Comment:
Yes. The Azure SDK uses exceptions.
--
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]