From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Leonid Vasiliev <lvasiliev@tarantool.org>, tarantool-patches@dev.tarantool.org Cc: Sergey Bronnikov <estetus@gmail.com>, alexander.turenko@tarantool.org Subject: Re: [Tarantool-patches] [PATCH v1 1/4] test: fix app-tap/http_client.test.lua Date: Thu, 14 Jan 2021 12:50:50 +0300 [thread overview] Message-ID: <14e9dff9-3088-afc7-5b5a-b0c4beabd23c@tarantool.org> (raw) In-Reply-To: <7a67487e-5f8c-3399-1ac0-fb085b83d4f7@tarantool.org> 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 <estetus@gmail.com> >> >> 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 <sergeyb@tarantool.org> 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) >>
next prev parent reply other threads:[~2021-01-14 9:50 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-01-13 8:48 [Tarantool-patches] [PATCH v1 0/4] Support Python 3 in Tarantool tests Sergey Bronnikov via Tarantool-patches 2021-01-13 8:48 ` [Tarantool-patches] [PATCH v1 1/4] test: fix app-tap/http_client.test.lua Sergey Bronnikov via Tarantool-patches 2021-01-14 8:47 ` Leonid Vasiliev via Tarantool-patches 2021-01-14 9:50 ` Sergey Bronnikov via Tarantool-patches [this message] 2021-01-14 12:23 ` Alexander Turenko via Tarantool-patches 2021-01-14 12:52 ` Sergey Bronnikov via Tarantool-patches 2021-01-14 12:57 ` Alexander Turenko via Tarantool-patches 2021-01-13 8:48 ` [Tarantool-patches] [PATCH v1 2/4] test: fix xlog-py/big_lsn.test.py Sergey Bronnikov via Tarantool-patches 2021-01-14 9:02 ` Leonid Vasiliev via Tarantool-patches 2021-01-14 9:51 ` Sergey Bronnikov via Tarantool-patches 2021-01-14 12:38 ` Alexander Turenko via Tarantool-patches 2021-01-14 12:52 ` Sergey Bronnikov via Tarantool-patches 2021-01-13 8:48 ` [Tarantool-patches] [PATCH v1 3/4] test: enable SO_REUSEADDR on socket in httpd.py Sergey Bronnikov via Tarantool-patches 2021-01-13 19:59 ` Cyrill Gorcunov via Tarantool-patches 2021-01-14 9:09 ` Leonid Vasiliev via Tarantool-patches 2021-01-14 9:57 ` Sergey Bronnikov via Tarantool-patches 2021-01-14 12:51 ` Alexander Turenko via Tarantool-patches 2021-01-13 8:48 ` [Tarantool-patches] [PATCH v1 4/4] test: enable disabled testcases back Sergey Bronnikov via Tarantool-patches 2021-01-14 9:10 ` Leonid Vasiliev via Tarantool-patches 2021-01-13 20:03 ` [Tarantool-patches] [PATCH v1 0/4] Support Python 3 in Tarantool tests Cyrill Gorcunov via Tarantool-patches 2021-01-14 11:10 ` Leonid Vasiliev via Tarantool-patches 2021-01-15 9:34 ` Kirill Yukhin via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=14e9dff9-3088-afc7-5b5a-b0c4beabd23c@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=alexander.turenko@tarantool.org \ --cc=estetus@gmail.com \ --cc=lvasiliev@tarantool.org \ --cc=sergeyb@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v1 1/4] test: fix app-tap/http_client.test.lua' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox