Skip to content

Commit 8a2ab48

Browse files
committed
Add function to get complaint index by title
1 parent 6e45157 commit 8a2ab48

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

op_robot_tests/tests_files/service_keywords.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,18 @@ def get_complaint_index_by_complaintID(data, complaintID):
442442
return index
443443

444444

445+
446+
def get_complaint_index_by_complaintTitle(data, complaintTitle):
447+
if not data:
448+
return 0
449+
for index, element in enumerate(data):
450+
if element.get('title', '') == complaintTitle:
451+
break
452+
else:
453+
index += 1
454+
return index
455+
456+
445457
def generate_test_bid_data(tender_data):
446458
bid = test_bid_data()
447459
if tender_data.get('procurementMethodType', '')[:-2] in ('aboveThreshold', 'competitiveDialogue'):

0 commit comments

Comments
 (0)