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 26A6264672; Wed, 13 Jan 2021 11:49:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 26A6264672 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610527758; bh=eM7sJ2lSy/ppg/Mn11siziLwi2PZ+qcRE1wNVArqXh8=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=N5s16GQoVF6lrxEp7MZy0QSpqEbEW0Y71f65Vsh01szP+ovRiEPjV8R2EpK2/JNZ/ kztamy8swh07QTc5nCAQ59SfHAhjyGLGvizqRIEkQbL1DBFGxEQ4mUR8Ky5Jd5ytgH /h2diOU8AeCY53n3WP10Q2wDd2NiD50p88I8kvH0= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 91F9D64672 for ; Wed, 13 Jan 2021 11:48:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 91F9D64672 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1kzbpl-0007V2-MJ; Wed, 13 Jan 2021 11:48:54 +0300 To: tarantool-patches@dev.tarantool.org, lvasiliev@tarantool.org Cc: Sergey Bronnikov , alexander.turenko@tarantool.org Date: Wed, 13 Jan 2021 11:48:30 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CD81CC0669AF3BE2AC14A0BAA29BC1501600894C459B0CD1B9033610402422667AFBCC5A47CB9D5BC954F7F300FA7FCDDC838627A7128B43D1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70043D879A87EF1BCEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637352A1F9739ED04D38638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC081036C1CE0AB3147479FC6E68EE9AB99B66E78B2BB71C96389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0C26CFBAC0749D213D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BF1175FABE1C0F9B6A471835C12D1D977C4224003CC836476EC64975D915A344093EC92FD9297F6718AA50765F79006372C56F9BC9525AE6AA7F4EDE966BC389F395957E7521B51C24C7702A67D5C33162DBA43225CD8A89FC0F9454058DFE53CC6EABA9B74D0DA47B5C8C57E37DE458B4C7702A67D5C3316FA3894348FB808DBCF17F1EDFBC1FB573B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CD9CBB3A052EDBDE5A80C60BDCC3C160DBB41F7EE6FF5AF309C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF6EA1BA7CA28B4A74699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3450C5E6D685282BA1396D7B84412BFEEC1EFD89D17CADF85F9D2DCE7F120B84B2FE7FA80B8FBCF46E1D7E09C32AA3244C31C0F0B537C8EBFA3A7B6336988384F2B4DF56057A86259F927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj4exXbGs3yZp4tAyNx9MzmA== X-Mailru-Sender: 689FA8AB762F73937240DDB2502DDB70377ED1F4922FC8C14FAF196805A05F76DD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [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: sergeyb@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Sergey Bronnikov Pass http body as byte string and define string literals correctly. Part of #5538 --- 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()): 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()): if "HTTP_" in key: headers.append((key[5:].lower(), value)) response(code, headers) -- 2.25.1