提交 9dc70545 编写于 作者: T tai 提交者: zhang2014

Add TestCase for feature/ISSUE-5436

上级 61d33a8d
<yandex>
<http_port>8123</http_port>
<CustomHTTP>
<HTTPMatch>
<URL>/${database}/a/${id}/${table}</URL>
<QUERY>INSERT INTO ${database:ASTIdentifier}.${table:ASTIdentifier}(id) VALUES</QUERY>
<QUERY>SELECT * FROM ${database:ASTIdenfier}.t</QUERY>
<QUERY>SELECT * FROM a.${table:ASTIdenfier} WHERE id={id:UInt8}</QUERY>
</HTTPMatch>
</CustomHTTP>
</yandex>
import pytest
import requests
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', main_configs=['configs/custom_http.xml'])
@pytest.fixture(scope="module")
def start_cluster():
try:
cluster.start()
node.query('''
CREATE DATABASE `test`;
CREATE TABLE `test`.`test_custom_http` (`id` UInt8) Engine=Memory;
''')
yield cluster
finally:
cluster.shutdown()
def test(started_cluster):
node_ip = cluster.get_instance_ip(node)
url = 'http://%s:8123/test/a/1/test_custom_http' % node_ip
data="(1)"
params = {'id':1}
response = requests.post(url, params = params, data = data)
assert response.text == '\n1\n1\n'
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册