Skip to content

Commit

Permalink
lib: use random values for ranges, closes nspcc-dev#632
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
  • Loading branch information
Evgeniy Zayats committed Sep 23, 2023
1 parent af5aa53 commit 58c9d70
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions robot/resources/lib/python_keywords/object_access.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import random
from typing import Optional

import allure
Expand Down Expand Up @@ -142,6 +143,12 @@ def can_get_head_object(
return True


def _generate_random_range_cut(start: int = 0, end: int = 10):
start = random.randint(start, end)
end = random.randint(start, end)
return f"{start}:{end}"


def can_get_range_of_object(
wallet: str,
cid: str,
Expand All @@ -159,7 +166,7 @@ def can_get_range_of_object(
cid,
oid,
bearer=bearer,
range_cut="0:10",
range_cut=_generate_random_range_cut(),
wallet_config=wallet_config,
xhdr=xhdr,
shell=shell,
Expand Down Expand Up @@ -190,7 +197,7 @@ def can_get_range_hash_of_object(
cid,
oid,
bearer=bearer,
range_cut="0:10",
range_cut=_generate_random_range_cut(),
wallet_config=wallet_config,
xhdr=xhdr,
shell=shell,
Expand Down

0 comments on commit 58c9d70

Please sign in to comment.