From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 2171F4C889; Thu, 14 Jan 2021 12:50:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2171F4C889 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610617852; bh=IBrFlfBIi/VMxWDQEOrQhKAUCWIB9vqWEa+xRS8lctc=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=BMg62uiTvjtwZ+ZJb2hjlDJGJ/U13SJVAy/aUIOOiUB0tPfaNE/7ZsGTw/5ut6HCs HSSZO1kscaCLtk6DBH5/oHe2b9hbIplBUkLkSVrXEP5hKztu+RwfjGtrF/lhpMqpZS ATJ4OwwYCiU/rV/pXmrYJi7qmKObkIIAjqNtu5s0= Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 262AD4C885 for ; Thu, 14 Jan 2021 12:50:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 262AD4C885 Received: by smtp50.i.mail.ru with esmtpa (envelope-from ) id 1kzzHG-0006Fd-Cl; Thu, 14 Jan 2021 12:50:50 +0300 To: Leonid Vasiliev , tarantool-patches@dev.tarantool.org Cc: Sergey Bronnikov , alexander.turenko@tarantool.org References: <7a67487e-5f8c-3399-1ac0-fb085b83d4f7@tarantool.org> Message-ID: <14e9dff9-3088-afc7-5b5a-b0c4beabd23c@tarantool.org> Date: Thu, 14 Jan 2021 12:50:50 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <7a67487e-5f8c-3399-1ac0-fb085b83d4f7@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CD9807AE62CAC2B33C765C844EAC374FFF00894C459B0CD1B9EFA5AF3A10E3FEC7AF68CF84474E2F6A5D3D06EE5197295900F5F90D052F6071 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73B44982FA5E78411EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637352A1F9739ED04D38638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC20F4D7051A8063182116B329C722B59B45ECD2C800857AE5389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6957A4DEDD2346B42CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C22497569BBACE04DC79776E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8B0E49D912963171283AA81AA40904B5D9DBF02ECDB25306B2B25CBF701D1BE8734AD6D5ED66289B5278DA827A17800CE7F9581457D50944AB67F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C377DC896192EAD7AA35872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9DE2850DD75B2526BE5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: 0D63561A33F958A537A4E919A2B0AAB4972071AFE4DCAF9596DC5AC0EE4F6E0ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA758F9E841AEAEC4F2C410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3438BC6CF312DA7315E8ABA2AECE5561366A9A3085F75270A205933E7AA15B8E71BD1D2CAECBFAD7541D7E09C32AA3244C0D124DC58641C686DCC557E515A3F6AD250262A5EE9971B0927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj9kdO2HH36x48EhbE4Hv+IQ== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458CB4B75BDB2F0D52B50E452E3C2963E8A183FD40C0D865191282EC151BADDC1D3523A6D01B4765B2DFB59E2DDD9FE06B14FA522850F29BC30112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 1/4] test: fix app-tap/http_client.test.lua X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for review! On 14.01.2021 11:47, Leonid Vasiliev wrote: > Hi! Thank you for the patch. > > Generally LGTM. See some comments below: > > On 13.01.2021 11:48, sergeyb@tarantool.org wrote: >> From: Sergey Bronnikov >> >> Pass http body as byte string and define string literals correctly. >> >> Part of #5538 > > AFAIU, if the task has been closed, new patches corresponding with the > task are marked as "Follows up". > Updated commit messages. >> --- >>   test/app-tap/httpd.py | 20 ++++++++++---------- >>   1 file changed, 10 insertions(+), 10 deletions(-) >> >> diff --git a/test/app-tap/httpd.py b/test/app-tap/httpd.py >> index a2dee1b83..62435e91a 100755 >> --- a/test/app-tap/httpd.py >> +++ b/test/app-tap/httpd.py >> @@ -7,24 +7,24 @@ from gevent import spawn, sleep, socket >>   def absent(): >>       code = "500 Server Error" >>       headers = [("Content-Type", "application/json")] >> -    body = ["No such method"] >> +    body = [b'No such method'] >>       return code, body, headers >>     def hello(): >>       code = "200 OK" >> -    body = ["hello world"] >> +    body = [b'hello world'] >>       headers = [("Content-Type", "application/json")] >>       return code, body, headers >>     def hello1(): >>       code = "200 OK" >> -    body = [b"abc"] >> +    body = [b'abc'] >>       headers = [("Content-Type", "application/json")] >>       return code, body, headers >>     def headers(): >>       code = "200 OK" >> -    body = [b"cookies"] >> +    body = [b'cookies'] >>       headers = [("Content-Type", "application/json"), >>                  ("Content-Type", "application/yaml"), >>                  ("Set-Cookie", "likes=cheese; Expires=Wed, 21 Oct >> 2015 07:28:00 GMT; Secure; HttpOnly"), >> @@ -41,13 +41,13 @@ def headers(): >>   def long_query(): >>       sleep(0.005) >>       code = "200 OK" >> -    body = [b"abc"] >> +    body = [b'abc'] >>       headers = [("Content-Type", "application/json")] >>       return code, body, headers >>     def redirect(): >>       code = "302 Found" >> -    body = ["redirecting"] >> +    body = [b'redirecting'] >>       headers = [("Location", "/")] >>       return code, body, headers >>   @@ -63,7 +63,7 @@ paths = { >>   def read_handle(env, response): >>       code = "404 Not Found" >>       headers = [] >> -    body = ["Not Found"] >> +    body = [b'Not Found'] >>       if env["PATH_INFO"] in paths: >>           code, body, headers = paths[env["PATH_INFO"]]() >>       for key,value in iter(env.items()): >> @@ -76,7 +76,7 @@ def post_handle(env, response): >>       code = "200 OK" >>       body = [env["wsgi.input"].read()] >>       headers = [] >> -    for key,value in env.iteritems(): >> +    for key,value in iter(env.items()): > > This change is not about "Pass http body as byte string and define > string literals correctly." Please edit the commit message or move > this change to a separate commit. > commit 00c194f09b230cd01f38ed7e08e5fcc7e2d56928 Author: Sergey Bronnikov Date:   Mon Dec 28 15:15:41 2020 +0300     test: fix app-tap/http_client.test.lua     Pass http body as byte string, define string literals correctly     and make items() iterable.     Follows up #5538 >>           if "HTTP_" in key: >>               headers.append((key[5:].lower(), value)) >>       response(code, headers) >> @@ -84,8 +84,8 @@ def post_handle(env, response): >>     def other_handle(env, response, method, code): >>       headers = [("Content-Type", "text/plain"), ("method", method)] >> -    body = [method] >> -    for key,value in env.iteritems(): >> +    body = [method.encode('utf-8')] > >> +    for key,value in iter(env.items()): > > This change is not about "Pass http body as byte string and define > string literals correctly." Please edit the commit message or move > this change to a separate commit. > >>           if "HTTP_" in key: >>               headers.append((key[5:].lower(), value)) >>       response(code, headers) >>