Fix code style

This commit is contained in:
JackyWoo 2024-08-21 09:14:50 +08:00
parent 0563e19cf3
commit 3c7e2389d1

View File

@ -2,6 +2,7 @@ import logging
import pytest
from helpers.cluster import ClickHouseCluster
@pytest.fixture(scope="module")
def cluster():
try:
@ -10,7 +11,7 @@ def cluster():
"node",
main_configs=[
"configs/config.d/cluster.xml",
]
],
)
logging.info("Starting cluster...")
cluster.start()
@ -28,7 +29,8 @@ def test_incorrect_datetime_format(cluster):
node = cluster.instances["node"]
node.query("""
node.query(
"""
CREATE TABLE tab
(
a DateTime,
@ -40,10 +42,12 @@ def test_incorrect_datetime_format(cluster):
res = node.query("SELECT count(*) FROM tab WHERE a = '2024-08-06 09:58:09'").strip()
assert res == "0"
error = node.query_and_get_error("SELECT count(*) FROM tab WHERE a = '2024-08-06 09:58:0'").strip()
print(error)
error = node.query_and_get_error(
"SELECT count(*) FROM tab WHERE a = '2024-08-06 09:58:0'"
).strip()
assert "Cannot parse time component of DateTime 09:58:0" in error
error = node.query_and_get_error("SELECT count(*) FROM tab WHERE a = '2024-08-0 09:58:09'").strip()
print(error)
error = node.query_and_get_error(
"SELECT count(*) FROM tab WHERE a = '2024-08-0 09:58:09'"
).strip()
assert "Cannot convert string '2024-08-0 09:58:09' to type DateTime" in error