diff options
author | kulikov <kulikov@yandex-team.ru> | 2022-02-10 16:49:34 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:34 +0300 |
commit | c707901605d7b7c6cba0998cd52e1ae619c97762 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/http/server/response_ut.cpp | |
parent | 65e5266709e7ff94b14ae128309e229de714b0df (diff) | |
download | ydb-c707901605d7b7c6cba0998cd52e1ae619c97762.tar.gz |
Restoring authorship annotation for <kulikov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/http/server/response_ut.cpp')
-rw-r--r-- | library/cpp/http/server/response_ut.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/http/server/response_ut.cpp b/library/cpp/http/server/response_ut.cpp index 8a142fb1ba..73e2112ad3 100644 --- a/library/cpp/http/server/response_ut.cpp +++ b/library/cpp/http/server/response_ut.cpp @@ -46,25 +46,25 @@ Y_UNIT_TEST_SUITE(TestHttpResponse) { EXPECTED); } - Y_UNIT_TEST(TestGetHeaders) { - THttpResponse resp(HTTP_FORBIDDEN); - - THttpHeaders headers; - headers.AddHeader(THttpInputHeader("X-Header-1", "ValueOne")); - headers.AddHeader(THttpInputHeader("X-Header-2", "ValueTwo")); - headers.AddHeader(THttpInputHeader("X-Header-3", "ValueThree")); - resp.AddMultipleHeaders(headers); - resp.AddHeader("X-Header-4", "ValueFour"); - - const THttpHeaders& gotHeaders = resp.GetHeaders(); - UNIT_ASSERT_VALUES_EQUAL(gotHeaders.Count(), 4); - UNIT_ASSERT(gotHeaders.HasHeader("X-Header-1")); - UNIT_ASSERT_STRINGS_EQUAL(gotHeaders.FindHeader("X-Header-1")->Value(), "ValueOne"); - UNIT_ASSERT(gotHeaders.HasHeader("X-Header-4")); - UNIT_ASSERT_STRINGS_EQUAL(gotHeaders.FindHeader("X-Header-4")->Value(), "ValueFour"); - } - - + Y_UNIT_TEST(TestGetHeaders) { + THttpResponse resp(HTTP_FORBIDDEN); + + THttpHeaders headers; + headers.AddHeader(THttpInputHeader("X-Header-1", "ValueOne")); + headers.AddHeader(THttpInputHeader("X-Header-2", "ValueTwo")); + headers.AddHeader(THttpInputHeader("X-Header-3", "ValueThree")); + resp.AddMultipleHeaders(headers); + resp.AddHeader("X-Header-4", "ValueFour"); + + const THttpHeaders& gotHeaders = resp.GetHeaders(); + UNIT_ASSERT_VALUES_EQUAL(gotHeaders.Count(), 4); + UNIT_ASSERT(gotHeaders.HasHeader("X-Header-1")); + UNIT_ASSERT_STRINGS_EQUAL(gotHeaders.FindHeader("X-Header-1")->Value(), "ValueOne"); + UNIT_ASSERT(gotHeaders.HasHeader("X-Header-4")); + UNIT_ASSERT_STRINGS_EQUAL(gotHeaders.FindHeader("X-Header-4")->Value(), "ValueFour"); + } + + Y_UNIT_TEST(TestSetContent) { const char* EXPECTED = "HTTP/1.1 200 Ok\r\n" "Content-Length: 10\r\n" |