forked from TrueCloudLab/frostfs-testcases
[#314] Format all files with black and isort
Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
This commit is contained in:
parent
26032a67ec
commit
147cac0ebc
46 changed files with 1506 additions and 1100 deletions
|
@ -4,37 +4,37 @@ import re
|
|||
import allure
|
||||
from pytest import Config
|
||||
|
||||
logger = logging.getLogger('NeoLogger')
|
||||
logger = logging.getLogger("NeoLogger")
|
||||
|
||||
|
||||
@allure.step('Read environment.properties')
|
||||
@allure.step("Read environment.properties")
|
||||
def read_env_properties(config: Config) -> dict:
|
||||
environment_dir = config.getoption('--alluredir')
|
||||
environment_dir = config.getoption("--alluredir")
|
||||
if not environment_dir:
|
||||
return None
|
||||
|
||||
file_path = f'{environment_dir}/environment.properties'
|
||||
with open(file_path, 'r') as file:
|
||||
file_path = f"{environment_dir}/environment.properties"
|
||||
with open(file_path, "r") as file:
|
||||
raw_content = file.read()
|
||||
|
||||
env_properties = {}
|
||||
for line in raw_content.split('\n'):
|
||||
m = re.match('(.*?)=(.*)', line)
|
||||
for line in raw_content.split("\n"):
|
||||
m = re.match("(.*?)=(.*)", line)
|
||||
if not m:
|
||||
logger.warning(f'Could not parse env property from {line}')
|
||||
logger.warning(f"Could not parse env property from {line}")
|
||||
continue
|
||||
key, value = m.group(1), m.group(2)
|
||||
env_properties[key] = value
|
||||
return env_properties
|
||||
|
||||
|
||||
@allure.step('Update data in environment.properties')
|
||||
@allure.step("Update data in environment.properties")
|
||||
def save_env_properties(config: Config, env_data: dict) -> None:
|
||||
environment_dir = config.getoption('--alluredir')
|
||||
environment_dir = config.getoption("--alluredir")
|
||||
if not environment_dir:
|
||||
return None
|
||||
|
||||
file_path = f'{environment_dir}/environment.properties'
|
||||
with open(file_path, 'a+') as env_file:
|
||||
file_path = f"{environment_dir}/environment.properties"
|
||||
with open(file_path, "a+") as env_file:
|
||||
for env, env_value in env_data.items():
|
||||
env_file.write(f'{env}={env_value}\n')
|
||||
env_file.write(f"{env}={env_value}\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue