MCPcopy Create free account
hub / github.com/apache/arrow / TestGetFlightInfo

Method TestGetFlightInfo

cpp/src/arrow/flight/test_definitions.cc:1708–1741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1706}
1707
1708void ErrorHandlingTest::TestGetFlightInfo() {
1709 std::unique_ptr<FlightInfo> info;
1710 for (const auto code : kStatusCodes) {
1711 ARROW_SCOPED_TRACE("C++ status code: ", static_cast<int>(code));
1712 auto descr = FlightDescriptor::Path(
1713 {std::to_string(static_cast<int>(code)), "Expected message"});
1714 auto status = client_->GetFlightInfo(descr).status();
1715 EXPECT_EQ(status.code(), code);
1716 EXPECT_THAT(status.message(), ::testing::HasSubstr("Expected message"));
1717
1718 // Custom status detail
1719 descr = FlightDescriptor::Path(
1720 {std::to_string(static_cast<int>(code)), "Expected message", ""});
1721 status = client_->GetFlightInfo(descr).status();
1722 EXPECT_EQ(status.code(), code);
1723 EXPECT_THAT(status.message(), ::testing::HasSubstr("Expected message"));
1724 EXPECT_THAT(status.message(), ::testing::HasSubstr("Detail: Custom status detail"));
1725
1726 // Flight status detail
1727 for (const auto flight_code : kFlightStatusCodes) {
1728 ARROW_SCOPED_TRACE("Flight status code: ", static_cast<int>(flight_code));
1729 descr = FlightDescriptor::Path(
1730 {std::to_string(static_cast<int>(code)), "Expected message",
1731 std::to_string(static_cast<int>(flight_code)), "Expected detail message"});
1732 status = client_->GetFlightInfo(descr).status();
1733 // Don't check status code, since Flight code may override it
1734 EXPECT_THAT(status.message(), ::testing::HasSubstr("Expected message"));
1735 auto detail = FlightStatusDetail::UnwrapStatus(status);
1736 ASSERT_NE(detail, nullptr);
1737 EXPECT_EQ(detail->code(), flight_code);
1738 EXPECT_THAT(detail->extra_info(), ::testing::HasSubstr("Expected detail message"));
1739 }
1740 }
1741}
1742
1743void ErrorHandlingTest::TestGetFlightInfoMetadata() {
1744 auto descr = FlightDescriptor::Path({"metadata"});

Callers

nothing calls this directly

Calls 9

to_stringFunction · 0.85
extra_infoMethod · 0.80
PathFunction · 0.70
CommandFunction · 0.70
statusMethod · 0.45
GetFlightInfoMethod · 0.45
codeMethod · 0.45
GetFlightInfoAsyncMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected