MCPcopy Create free account
hub / github.com/apache/brpc / TestBadMethod

Method TestBadMethod

test/brpc_builtin_service_unittest.cpp:257–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255 }
256
257 void TestBadMethod(bool use_html) {
258 std::string expect_type = (use_html ? "text/html" : "text/plain");
259 brpc::BadMethodService service;
260 brpc::BadMethodResponse res;
261 {
262 ClosureChecker done;
263 brpc::Controller cntl;
264 SetUpController(&cntl, use_html);
265 brpc::BadMethodRequest req;
266 req.set_service_name(
267 brpc::PProfService::descriptor()->full_name());
268 service.no_method(&cntl, &req, &res, &done);
269 EXPECT_EQ(brpc::ENOMETHOD, cntl.ErrorCode());
270 EXPECT_EQ(expect_type, cntl.http_response().content_type());
271 CheckErrorText(cntl, "growth");
272 }
273 }
274
275 void TestFlags(bool use_html) {
276 std::string expect_type = (use_html ? "text/html" : "text/plain");

Callers

nothing calls this directly

Calls 3

CheckErrorTextFunction · 0.85
no_methodMethod · 0.80
ErrorCodeMethod · 0.80

Tested by

no test coverage detected