ClickHouse/tests/integration/test_config_yaml_merge_keys/test.py
Azat Khuzhin 65e66f9860 Apply black for test_config_yaml_merge_keys
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-05-10 20:04:23 +02:00

40 lines
1.4 KiB
Python

import helpers
import pytest
from helpers.cluster import ClickHouseCluster
def test_yaml_merge_keys_conf():
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance("node", user_configs=["configs/merge_keys.yml"])
try:
cluster.start()
# Assert simple merge key substitution
assert node.query("select getSetting('max_threads')", user="user_1") == "1\n"
# Assert merge key overriden by regular key
assert node.query("select getSetting('max_threads')", user="user_2") == "4\n"
# Assert normal key overriden by merge key
assert node.query("select getSetting('max_threads')", user="user_3") == "4\n"
# Assert override with multiple merge keys
assert (
node.query("select getSetting('max_final_threads')", user="user_4") == "2\n"
)
# Assert multiple merge key substitutions overriden by regular key
assert node.query("select getSetting('max_threads')", user="user_4") == "4\n"
# Assert override with multiple merge keys for list syntax
assert (
node.query("select getSetting('max_final_threads')", user="user_5") == "2\n"
)
# Assert multiple merge key substitutions overriden by regular key
# for list syntax
assert node.query("select getSetting('max_threads')", user="user_5") == "4\n"
finally:
cluster.shutdown()