Fix string representation for load params with empty fields

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2023-07-27 10:49:41 +03:00
parent b856e82008
commit 612e088763
3 changed files with 43 additions and 8 deletions

View file

@ -316,8 +316,14 @@ class LoadParams:
return fields_with_data or []
def __str__(self) -> str:
size, unit = calc_unit(self.object_size, 1)
static_params = [f"{self.scenario.value} ({size:.4g} {unit})"]
load_type_str = self.scenario.value if self.scenario else self.load_type.value
# TODO: migrate load_params defaults to testlib
if self.object_size is not None:
size, unit = calc_unit(self.object_size, 1)
static_params = [f"{load_type_str} ({size:.4g} {unit})"]
else:
static_params = [f"{load_type_str}"]
dynamic_params = [
f"{meta_field.name}={meta_field.value}"
for meta_field in self._get_applicable_fields()