Skip to content

Commit

Permalink
update formating
Browse files Browse the repository at this point in the history
  • Loading branch information
Selfeer committed Apr 23, 2024
1 parent 6d7381a commit 2eb6866
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 128 deletions.
4 changes: 2 additions & 2 deletions parquet/tests/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def insert_into_engine(self):
)

with Check("I check the data inserted into a new table"):
table1 = node.query(f"SELECT * FROM {table_name_merge_tree}")
table2 = node.query(f"SELECT * FROM {table_name_parquet_file}")
table1 = node.query(f"SELECT * FROM {table_name_merge_tree} FORMAT TabSeparated")
table2 = node.query(f"SELECT * FROM {table_name_parquet_file} FORMAT TabSeparated")
assert table1.output.strip() == table2.output.strip(), error()

with Check(
Expand Down
36 changes: 18 additions & 18 deletions rbac/tests/privileges/dictGet.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def dictGet_check(self, privilege, on, grant_target_name, user_name, node=None):

with Then("I attempt to dictGet without privilege"):
node.query(
f"SELECT dictGet ({dict_name},'y',toUInt64(1))",
f"SELECT dictGet ({dict_name},'y',toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand All @@ -129,7 +129,7 @@ def dictGet_check(self, privilege, on, grant_target_name, user_name, node=None):

with Then("I attempt to dictGet with privilege"):
node.query(
f"SELECT dictGet ({dict_name},'y',toUInt64(1))",
f"SELECT dictGet ({dict_name},'y',toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
)

Expand All @@ -143,7 +143,7 @@ def dictGet_check(self, privilege, on, grant_target_name, user_name, node=None):

with When("I attempt to dictGet without privilege"):
node.query(
f"SELECT dictGet ({dict_name},'y',toUInt64(1))",
f"SELECT dictGet ({dict_name},'y',toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand Down Expand Up @@ -236,7 +236,7 @@ def dictGetOrDefault_check(

with Then("I attempt to dictGetOrDefault without privilege"):
node.query(
f"SELECT dictGetOrDefault ({dict_name},'y',toUInt64(1),toUInt64(1))",
f"SELECT dictGetOrDefault ({dict_name},'y',toUInt64(1),toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand All @@ -249,7 +249,7 @@ def dictGetOrDefault_check(

with Then("I attempt to dictGetOrDefault with privilege"):
node.query(
f"SELECT dictGetOrDefault ({dict_name},'y',toUInt64(1),toUInt64(1))",
f"SELECT dictGetOrDefault ({dict_name},'y',toUInt64(1),toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
)

Expand All @@ -263,7 +263,7 @@ def dictGetOrDefault_check(

with When("I attempt to dictGetOrDefault without privilege"):
node.query(
f"SELECT dictGetOrDefault ({dict_name},'y',toUInt64(1),toUInt64(1))",
f"SELECT dictGetOrDefault ({dict_name},'y',toUInt64(1),toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand Down Expand Up @@ -354,7 +354,7 @@ def dictHas_check(self, privilege, on, grant_target_name, user_name, node=None):

with Then("I attempt to dictHas without privilege"):
node.query(
f"SELECT dictHas({dict_name},toUInt64(1))",
f"SELECT dictHas({dict_name},toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand All @@ -367,7 +367,7 @@ def dictHas_check(self, privilege, on, grant_target_name, user_name, node=None):

with Then("I attempt to dictHas with privilege"):
node.query(
f"SELECT dictHas({dict_name},toUInt64(1))",
f"SELECT dictHas({dict_name},toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
)

Expand All @@ -381,7 +381,7 @@ def dictHas_check(self, privilege, on, grant_target_name, user_name, node=None):

with When("I attempt to dictHas without privilege"):
node.query(
f"SELECT dictHas({dict_name},toUInt64(1))",
f"SELECT dictHas({dict_name},toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand Down Expand Up @@ -474,7 +474,7 @@ def dictGetHierarchy_check(

with Then("I attempt to dictGetHierarchy without privilege"):
node.query(
f"SELECT dictGetHierarchy({dict_name},toUInt64(1))",
f"SELECT dictGetHierarchy({dict_name},toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand All @@ -487,7 +487,7 @@ def dictGetHierarchy_check(

with Then("I attempt to dictGetHierarchy with privilege"):
node.query(
f"SELECT dictGetHierarchy({dict_name},toUInt64(1))",
f"SELECT dictGetHierarchy({dict_name},toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
)

Expand All @@ -501,7 +501,7 @@ def dictGetHierarchy_check(

with When("I attempt to dictGetHierarchy without privilege"):
node.query(
f"SELECT dictGetHierarchy({dict_name},toUInt64(1))",
f"SELECT dictGetHierarchy({dict_name},toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand Down Expand Up @@ -592,7 +592,7 @@ def dictIsIn_check(self, privilege, on, grant_target_name, user_name, node=None)

with Then("I attempt to dictIsIn without privilege"):
node.query(
f"SELECT dictIsIn({dict_name},toUInt64(1),toUInt64(1))",
f"SELECT dictIsIn({dict_name},toUInt64(1),toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand All @@ -605,7 +605,7 @@ def dictIsIn_check(self, privilege, on, grant_target_name, user_name, node=None)

with Then("I attempt to dictIsIn with privilege"):
node.query(
f"SELECT dictIsIn({dict_name},toUInt64(1),toUInt64(1))",
f"SELECT dictIsIn({dict_name},toUInt64(1),toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
)

Expand All @@ -619,7 +619,7 @@ def dictIsIn_check(self, privilege, on, grant_target_name, user_name, node=None)

with When("I attempt to dictIsIn without privilege"):
node.query(
f"SELECT dictIsIn({dict_name},toUInt64(1),toUInt64(1))",
f"SELECT dictIsIn({dict_name},toUInt64(1),toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand Down Expand Up @@ -750,7 +750,7 @@ def dictGetType_check(

with Then("I attempt to dictGet without privilege"):
node.query(
f"SELECT dictGet{type}({dict_name},'z',toUInt64(1))",
f"SELECT dictGet{type}({dict_name},'z',toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand All @@ -763,7 +763,7 @@ def dictGetType_check(

with Then("I attempt to dictGet with privilege"):
node.query(
f"SELECT dictGet{type}({dict_name},'z',toUInt64(1))",
f"SELECT dictGet{type}({dict_name},'z',toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
)

Expand All @@ -777,7 +777,7 @@ def dictGetType_check(

with When("I attempt to dictGet without privilege"):
node.query(
f"SELECT dictGet{type}({dict_name},'z',toUInt64(1))",
f"SELECT dictGet{type}({dict_name},'z',toUInt64(1)) FORMAT TabSeparated",
settings=[("user", user_name)],
exitcode=exitcode,
message=message,
Expand Down
46 changes: 23 additions & 23 deletions rbac/tests/privileges/distributed_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def select_without_privilege(self, node=None):

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand Down Expand Up @@ -384,7 +384,7 @@ def select_with_privilege(self, user_name, grant_target_name, node=None):

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -398,7 +398,7 @@ def select_with_privilege(self, user_name, grant_target_name, node=None):

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -409,7 +409,7 @@ def select_with_privilege(self, user_name, grant_target_name, node=None):

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table1_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

finally:
Expand Down Expand Up @@ -475,7 +475,7 @@ def select_with_privilege(self, user_name, grant_target_name, node=None):

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table1_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

finally:
Expand Down Expand Up @@ -753,7 +753,7 @@ def select_with_table_on_materialized_view(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -764,7 +764,7 @@ def select_with_table_on_materialized_view(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -778,7 +778,7 @@ def select_with_table_on_materialized_view(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -789,15 +789,15 @@ def select_with_table_on_materialized_view(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table1_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

with When("I revoke ALL privileges"):
node.query(f"REVOKE ALL ON *.* FROM {grant_target_name}")

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -808,7 +808,7 @@ def select_with_table_on_materialized_view(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table1_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

finally:
Expand Down Expand Up @@ -893,7 +893,7 @@ def select_with_table_on_source_table_of_materialized_view(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -907,7 +907,7 @@ def select_with_table_on_source_table_of_materialized_view(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -918,7 +918,7 @@ def select_with_table_on_source_table_of_materialized_view(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table1_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

with When("I revoke ALL privileges"):
Expand All @@ -937,7 +937,7 @@ def select_with_table_on_source_table_of_materialized_view(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table1_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

finally:
Expand Down Expand Up @@ -1031,7 +1031,7 @@ def select_with_table_on_distributed_table(
"I attempt to select from the distributed table as the user"
):
node.query(
f"SELECT * FROM {table2_name}",
f"SELECT * FROM {table2_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -1048,7 +1048,7 @@ def select_with_table_on_distributed_table(
):
with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table2_name}",
f"SELECT * FROM {table2_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
)

Expand All @@ -1057,7 +1057,7 @@ def select_with_table_on_distributed_table(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table2_name}",
f"SELECT * FROM {table2_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand All @@ -1068,7 +1068,7 @@ def select_with_table_on_distributed_table(

with Then("I attempt to select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table2_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table2_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

finally:
Expand Down Expand Up @@ -1548,7 +1548,7 @@ def local_user(self, cluster, node=None):

with Then("I select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table1_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

with When("I revoke ALL privileges"):
Expand All @@ -1559,7 +1559,7 @@ def local_user(self, cluster, node=None):

with Then("I select from the distributed table as the user"):
node.query(
f"SELECT * FROM {table1_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table1_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

finally:
Expand Down Expand Up @@ -1612,14 +1612,14 @@ def multiple_node_user(self, node=None):
"I select from the distributed table on the node where the user has privileges"
):
node.query(
f"SELECT * FROM {table1_name}", settings=[("user", f"{user_name}")]
f"SELECT * FROM {table1_name} FORMAT TabSeparated", settings=[("user", f"{user_name}")]
)

with And(
"I select from the distributed table on the node the user doesn't have privileges"
):
node2.query(
f"SELECT * FROM {table1_name}",
f"SELECT * FROM {table1_name} FORMAT TabSeparated",
settings=[("user", f"{user_name}")],
exitcode=exitcode,
message=message,
Expand Down
4 changes: 2 additions & 2 deletions rbac/tests/privileges/grant_drop_user_race.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def feature(self, stress=None, node="clickhouse1"):
with Finally(f"I check if {user0_name} succesfully gained privileges."):
if self.context.privilege:
node.query(
f"SELECT * FROM {table_name}",
f"SELECT * FROM {table_name} FORMAT TabSeparated",
settings=[("user", user0_name)],
)
else:
node.query(
f"SELECT * FROM {table_name}",
f"SELECT * FROM {table_name} FORMAT TabSeparated",
message="DB::Exception: user0_grant_drop_user_race",
exitcode=241,
settings=[("user", user0_name)],
Expand Down
Loading

0 comments on commit 2eb6866

Please sign in to comment.