MCPcopy Create free account
hub / github.com/catboost/catboost / Y_UNIT_TEST

Function Y_UNIT_TEST

library/cpp/neh/http_ut.cpp:109–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 }
108
109 Y_UNIT_TEST(TTestAnyHttpCodeIsAccepted) {
110 auto responseWith523 = [](const IRequestRef& req) {
111 auto* httpReq = dynamic_cast<IHttpRequest*>(req.Get());
112
113 TData data;
114 httpReq->SendReply(data, {}, 523);
115 };
116
117 TServ serv = CreateServices(responseWith523);
118 NNeh::THandleRef handle = NNeh::Request(TStringBuilder() << "http://localhost:" << serv.ServerPort << "/pipeline?", nullptr);
119 auto resp = handle->Wait();
120
121 UNIT_ASSERT(resp);
122 UNIT_ASSERT(resp->IsError());
123 UNIT_ASSERT_EQUAL(resp->GetErrorCode(), 523);
124 }
125
126 Y_UNIT_TEST(TPipelineRequests) {
127 TServ serv = CreateServices();

Callers

nothing calls this directly

Calls 15

SetSocketTimeoutFunction · 0.85
SleepFunction · 0.85
MilliSecondsFunction · 0.85
selectFunction · 0.85
SetNonBlockFunction · 0.85
yexceptionClass · 0.85
SockAddrLenMethod · 0.80
GetErrorTextMethod · 0.80
CreateServicesFunction · 0.70
RequestFunction · 0.70
TRequestServerClass · 0.70
TStringBuilderClass · 0.50

Tested by

no test coverage detected