forked from TrueCloudLab/frostfs-testcases
robot/resources/lib/python
-> robot/resources/lib/python_keywords
Signed-off-by: anastasia prasolova <anastasia@nspcc.ru>
This commit is contained in:
parent
a97e1ee1e9
commit
3e31c527d2
17 changed files with 1 additions and 1 deletions
21
robot/resources/lib/python_keywords/data_formatters.py
Normal file
21
robot/resources/lib/python_keywords/data_formatters.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
"""
|
||||
A bunch of functions which might rearrange some data or
|
||||
change their representation.
|
||||
"""
|
||||
|
||||
from functools import reduce
|
||||
|
||||
|
||||
def dict_to_attrs(attrs: dict):
|
||||
'''
|
||||
This function takes dictionary of object attributes and converts them
|
||||
into the string. The string is passed to `--attibutes` key of the
|
||||
neofs-cli.
|
||||
|
||||
Args:
|
||||
attrs (dict): object attirbutes in {"a": "b", "c": "d"} format.
|
||||
|
||||
Returns:
|
||||
(str): string in "a=b,c=d" format.
|
||||
'''
|
||||
return reduce(lambda a,b: f"{a},{b}", map(lambda i: f"{i}={attrs[i]}", attrs))
|
Loading…
Add table
Add a link
Reference in a new issue