[#218] Object Size defined in int

Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
This commit is contained in:
Elizaveta Chichindaeva 2022-05-24 16:36:17 +03:00 committed by Anastasia Prasolova
parent 0799e15526
commit 6de6af81c7
3 changed files with 6 additions and 6 deletions

View file

@ -16,16 +16,15 @@ from robot.libraries.BuiltIn import BuiltIn
ROBOT_AUTO_KEYWORDS = False ROBOT_AUTO_KEYWORDS = False
@keyword('Generate file') @keyword('Generate file')
def generate_file_and_file_hash(size: str) -> str: def generate_file_and_file_hash(size: int) -> str:
""" """
Function generates a big binary file with the specified size in bytes and its hash. Function generates a big binary file with the specified size in bytes and its hash.
Args: Args:
size (str): the size in bytes, can be declared as 6e+6 for example size (int): the size in bytes, can be declared as 6e+6 for example
Returns: Returns:
(str): the path to the generated file (str): the path to the generated file
(str): the hash of the generated file (str): the hash of the generated file
""" """
size = int(float(size))
filename = f"{os.getcwd()}/{ASSETS_DIR}/{str(uuid.uuid4())}" filename = f"{os.getcwd()}/{ASSETS_DIR}/{str(uuid.uuid4())}"
with open(filename, 'wb') as fout: with open(filename, 'wb') as fout:
fout.write(os.urandom(size)) fout.write(os.urandom(size))

View file

@ -5,6 +5,7 @@ Library Collections
Library OperatingSystem Library OperatingSystem
Library neofs.py Library neofs.py
Library container.py
Library s3_gate.py Library s3_gate.py
Library contract_keywords.py Library contract_keywords.py
Library utility_keywords.py Library utility_keywords.py
@ -33,7 +34,7 @@ Buckets in NeoFS S3 Gateway
... ${SEC_ACCESS_KEY} ... ${SEC_ACCESS_KEY}
... ${OWNER_PRIV_KEY} = Init S3 Credentials ${WALLET} ... ${OWNER_PRIV_KEY} = Init S3 Credentials ${WALLET}
${CONTEINERS_LIST} = Container List ${WIF} @{CONTEINERS_LIST} = List Containers ${WALLET}
List Should Contain Value ${CONTEINERS_LIST} ${CID} List Should Contain Value ${CONTEINERS_LIST} ${CID}
${S3_CLIENT} = Config S3 client ${ACCESS_KEY_ID} ${SEC_ACCESS_KEY} ${S3_CLIENT} = Config S3 client ${ACCESS_KEY_ID} ${SEC_ACCESS_KEY}

View file

@ -11,8 +11,8 @@ CONTAINER_WAIT_INTERVAL = "1m"
NEOFS_EPOCH_TIMEOUT = (os.getenv("NEOFS_EPOCH_TIMEOUT") if os.getenv("NEOFS_EPOCH_TIMEOUT") NEOFS_EPOCH_TIMEOUT = (os.getenv("NEOFS_EPOCH_TIMEOUT") if os.getenv("NEOFS_EPOCH_TIMEOUT")
else os.getenv("NEOFS_IR_TIMERS_EPOCH", "300s")) else os.getenv("NEOFS_IR_TIMERS_EPOCH", "300s"))
SIMPLE_OBJ_SIZE = "1000" SIMPLE_OBJ_SIZE = 1000
COMPLEX_OBJ_SIZE = "2000" COMPLEX_OBJ_SIZE = 2000
MAINNET_BLOCK_TIME = os.getenv('MAINNET_BLOCK_TIME', "1s") MAINNET_BLOCK_TIME = os.getenv('MAINNET_BLOCK_TIME', "1s")
MAINNET_TIMEOUT = os.getenv('MAINNET_TIMEOUT', "1min") MAINNET_TIMEOUT = os.getenv('MAINNET_TIMEOUT', "1min")