mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
test is added
This commit is contained in:
parent
41ef0044f0
commit
3ff32fe81d
0
tests/integration/test_storage_dict/__init__.py
Normal file
0
tests/integration/test_storage_dict/__init__.py
Normal file
16
tests/integration/test_storage_dict/configs/conf.xml
Normal file
16
tests/integration/test_storage_dict/configs/conf.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<clickhouse>
|
||||
<named_collections>
|
||||
<urldb>
|
||||
<url>http://nginx:80/test_dict</url>
|
||||
<method>PUT</method>
|
||||
<format>TSV</format>
|
||||
<structure>k String, v String</structure>
|
||||
</urldb>
|
||||
<urldict>
|
||||
<url>http://nginx:80/</url>
|
||||
<endpoint>/test_dict</endpoint>
|
||||
<format>TabSeparated</format>
|
||||
</urldict>
|
||||
</named_collections>
|
||||
</clickhouse>
|
40
tests/integration/test_storage_dict/test.py
Normal file
40
tests/integration/test_storage_dict/test.py
Normal file
@ -0,0 +1,40 @@
|
||||
import pytest
|
||||
|
||||
from helpers.cluster import ClickHouseCluster
|
||||
|
||||
uuids = []
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def cluster():
|
||||
try:
|
||||
cluster = ClickHouseCluster(__file__)
|
||||
cluster.add_instance(
|
||||
"node1", main_configs=["configs/conf.xml"], with_nginx=True
|
||||
)
|
||||
cluster.start()
|
||||
|
||||
yield cluster
|
||||
|
||||
finally:
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
def test_storage_dict(cluster):
|
||||
node1 = cluster.instances["node1"]
|
||||
|
||||
node1.query(
|
||||
f"insert into table function url(urldb) values ('foo', 'bar')"
|
||||
)
|
||||
result = node1.query(
|
||||
f"select * from url(urldb)"
|
||||
)
|
||||
assert result.strip() == "foo\tbar"
|
||||
|
||||
node1.query(
|
||||
f"create dictionary dict (k String, v String) primary key k source(http(name urldict)) layout(complex_key_hashed()) lifetime(min 0 max 100)"
|
||||
)
|
||||
result = node1.query(
|
||||
f"select * from dict"
|
||||
)
|
||||
assert result.strip() == "foo\tbar"
|
Loading…
Reference in New Issue
Block a user