From e14896400f767ecac8fa381ee3fe7f9f34725d68 Mon Sep 17 00:00:00 2001 From: Andrey Berezin Date: Wed, 6 Sep 2023 16:51:18 +0300 Subject: [PATCH] Add post-init for load params Signed-off-by: Andrey Berezin --- src/frostfs_testlib/load/load_config.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/frostfs_testlib/load/load_config.py b/src/frostfs_testlib/load/load_config.py index 3a7e0b4..9023f87 100644 --- a/src/frostfs_testlib/load/load_config.py +++ b/src/frostfs_testlib/load/load_config.py @@ -271,6 +271,16 @@ class LoadParams: return env_vars + def __post_init__(self): + default_scenario_map = { + LoadType.gRPC: LoadScenario.gRPC, + LoadType.HTTP: LoadScenario.HTTP, + LoadType.S3: LoadScenario.S3, + } + + if self.scenario is None: + self.scenario = default_scenario_map[self.load_type] + def get_preset_arguments(self): command_args = [ self._get_preset_argument(meta_field) @@ -324,7 +334,7 @@ class LoadParams: # 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})"] + static_params = [f"{load_type_str} {size:.4g} {unit}"] else: static_params = [f"{load_type_str}"] @@ -335,7 +345,7 @@ class LoadParams: ] params = ", ".join(static_params + dynamic_params) - return f"load: {params}" + return params def __repr__(self) -> str: return self.__str__()