Skip to content

Commit 02d4fd2

Browse files
committed
Added test for put with compression and wrong credentials.
1 parent 174f49a commit 02d4fd2

File tree

1 file changed

+8
-7
lines changed
  • tests/integration/test_storage_s3

1 file changed

+8
-7
lines changed

tests/integration/test_storage_s3/test.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,13 @@ def run_query(instance, query, stdin=None, settings=None):
110110

111111

112112
# Test simple put.
113-
@pytest.mark.parametrize("maybe_auth,positive", [
114-
("", True),
115-
("'minio','minio123',", True),
116-
("'wrongid','wrongkey',", False)
113+
@pytest.mark.parametrize("maybe_auth,positive,compression", [
114+
("", True, 'auto'),
115+
("'minio','minio123',", True, 'auto'),
116+
("'wrongid','wrongkey',", False, 'auto'),
117+
("'wrongid','wrongkey',", False, 'gzip')
117118
])
118-
def test_put(cluster, maybe_auth, positive):
119+
def test_put(cluster, maybe_auth, positive, compression):
119120
# type: (ClickHouseCluster) -> None
120121

121122
bucket = cluster.minio_bucket if not maybe_auth else cluster.minio_restricted_bucket
@@ -124,8 +125,8 @@ def test_put(cluster, maybe_auth, positive):
124125
values = "(1, 2, 3), (3, 2, 1), (78, 43, 45)"
125126
values_csv = "1,2,3\n3,2,1\n78,43,45\n"
126127
filename = "test.csv"
127-
put_query = "insert into table function s3('http://{}:{}/{}/{}', {}'CSV', '{}') values {}".format(
128-
cluster.minio_host, cluster.minio_port, bucket, filename, maybe_auth, table_format, values)
128+
put_query = f"""insert into table function s3('http://{cluster.minio_host}:{cluster.minio_port}/{bucket}/{filename}',
129+
{maybe_auth}'CSV', '{table_format}', {compression}) values {values}"""
129130

130131
try:
131132
run_query(instance, put_query)

0 commit comments

Comments
 (0)