提交 4608da13 编写于 作者: V Vladimir Chebotarev

Minor tests improvement.

上级 64d49e45
......@@ -78,11 +78,9 @@ def test_get_with_redirect(started_cluster):
put_communication_data(started_cluster, "=== Get with redirect test ===")
query = "select *, column1*column2*column3 from s3('http://{}:{}/', 'CSV', '{}')".format(started_cluster.mock_host, started_cluster.redirecting_to_http_port, format)
stdout = run_query(instance, query)
assert list(map(str.split, stdout.splitlines())) == [
["42", "87", "44", "160776"],
["55", "33", "81", "147015"],
["1", "0", "9", "0"],
]
data = get_communication_data(started_cluster)
expected = [ [str(row[0]), str(row[1]), str(row[2]), str(row[0]*row[1]*row[2])] for row in data["redirect_csv_data"] ]
assert list(map(str.split, stdout.splitlines())) == expected
def test_put(started_cluster):
......
......@@ -68,7 +68,8 @@ class SimpleHTTPServerHandler(BaseHTTPRequestHandler):
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
self.wfile.write("42,87,44\n55,33,81\n1,0,9\n")
data["redirect_csv_data"] = [[42, 87, 44], [55, 33, 81], [1, 0, 9]]
self.wfile.write("".join([ "{},{},{}\n".format(*row) for row in data["redirect_csv_data"]]))
else:
self.send_response(404)
self.end_headers()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册