Commit cda42b5659f6eff6ad0aad843e3c5d3134f33baf

Authored by kosaniak
2 parents d70dc6ea 6cc9b3d1

Merge pull request #319 from mykhaly/return_statements

Use artificial id instead of internal in work with bid documents
... ... @@ -42,8 +42,7 @@ Resource base_keywords.robot
42 42 ${confidentialityRationale}= create_fake_sentence
43 43 ${privat_doc}= create_data_dict data.confidentialityRationale ${confidentialityRationale}
44 44 Set To Dictionary ${privat_doc.data} confidentiality=buyerOnly
45   - ${docid}= Get Variable Value ${USERS.users['${username}'].bidresponses['bid_doc_upload']['upload_response'].data.id}
46   - Run As ${username} Змінити документацію в ставці ${TENDER['TENDER_UAID']} ${privat_doc} ${docid}
  45 + Run As ${username} Змінити документацію в ставці ${TENDER['TENDER_UAID']} ${privat_doc} ${USERS.users['${username}'['bid_document']['doc_id']}
47 46
48 47
49 48 Можливість завантажити ${doc_type} документ до пропозиції учасником ${username}
... ... @@ -83,4 +82,4 @@ Resource base_keywords.robot
83 82
84 83
85 84 Активувати тендер другого етапу
86   - Run As ${tender_owner} активувати другий етап ${TENDER['TENDER_UAID']}
\ No newline at end of file
  85 + Run As ${tender_owner} активувати другий етап ${TENDER['TENDER_UAID']}
... ...
... ... @@ -970,15 +970,25 @@ Resource resource.robot
970 970
971 971 Можливість завантажити документ в пропозицію користувачем ${username}
972 972 ${file_path} ${file_name} ${file_content}= create_fake_doc
973   - ${bid_doc_upload}= Run As ${username} Завантажити документ в ставку ${file_path} ${TENDER['TENDER_UAID']}
974   - Set To Dictionary ${USERS.users['${username}'].bidresponses} bid_doc_upload=${bid_doc_upload}
  973 + ${doc_id}= get_id_from_string ${file_name}
  974 + ${bid_document_data}= Create Dictionary
  975 + ... doc_name=${file_name}
  976 + ... doc_content=${file_content}
  977 + ... doc_id=${doc_id}
  978 + Run As ${username} Завантажити документ в ставку ${file_path} ${TENDER['TENDER_UAID']}
  979 + Set To Dictionary ${USERS.users['${username}']} bid_document=${bid_document_data}
975 980 Remove File ${file_path}
976 981
977 982
978 983 Можливість змінити документацію цінової пропозиції користувачем ${username}
979 984 ${file_path} ${file_name} ${file_content}= create_fake_doc
980   - ${docid}= Get Variable Value ${USERS.users['${username}'].bidresponses['bid_doc_upload']['upload_response'].data.id}
981   - Run As ${username} Змінити документ в ставці ${TENDER['TENDER_UAID']} ${file_path} ${docid}
  985 + ${doc_id}= get_id_from_string ${file_name}
  986 + ${bid_document_modified_data}= Create Dictionary
  987 + ... doc_name=${file_name}
  988 + ... doc_content=${file_content}
  989 + ... doc_id=${doc_id}
  990 + Run As ${username} Змінити документ в ставці ${TENDER['TENDER_UAID']} ${file_path} ${USERS.users['${username}']['bid_document']['doc_id']}
  991 + Set To Dictionary ${USERS.users['${username}']} bid_document_modified=${bid_document_modified_data}
982 992 Remove File ${file_path}
983 993
984 994 ##############################################################################################
... ...
... ... @@ -752,11 +752,12 @@ Library openprocurement_client_helper.py
752 752
753 753
754 754 Змінити документ в ставці
755   - [Arguments] ${username} ${tender_uaid} ${path} ${docid}
  755 + [Arguments] ${username} ${tender_uaid} ${path} ${doc_id}
756 756 ${bid_id}= Get Variable Value ${USERS.users['${username}'].bidresponses['bid'].data.id}
757 757 ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid}
758 758 ${tender}= set_access_key ${tender} ${USERS.users['${username}']['access_token']}
759   - ${response}= Call Method ${USERS.users['${username}'].client} update_bid_document ${path} ${tender} ${bid_id} ${docid}
  759 + ${bid_doc}= get_document_by_id ${tender.data} ${doc_id}
  760 + ${response}= Call Method ${USERS.users['${username}'].client} update_bid_document ${path} ${tender} ${bid_id} ${bid_doc['id']}
760 761 ${uploaded_file} = Create Dictionary
761 762 ... filepath=${path}
762 763 ... upload_response=${response}
... ... @@ -765,11 +766,12 @@ Library openprocurement_client_helper.py
765 766
766 767
767 768 Змінити документацію в ставці
768   - [Arguments] ${username} ${tender_uaid} ${doc_data} ${docid}
  769 + [Arguments] ${username} ${tender_uaid} ${doc_data} ${doc_id}
769 770 ${bid_id}= Get Variable Value ${USERS.users['${username}'].bidresponses['bid'].data.id}
770 771 ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid}
771 772 ${tender}= set_access_key ${tender} ${USERS.users['${username}']['access_token']}
772   - ${reply}= Call Method ${USERS.users['${username}'].client} patch_bid_document ${tender} ${doc_data} ${bid_id} ${docid}
  773 + ${bid_doc}= get_document_by_id ${tender.data} ${doc_id}
  774 + ${reply}= Call Method ${USERS.users['${username}'].client} patch_bid_document ${tender} ${doc_data} ${bid_id} ${bid_doc['id']}
773 775
774 776
775 777 Отримати пропозицію
... ...
... ... @@ -65,6 +65,10 @@ def get_document_by_id(data, doc_id):
65 65 for document in cancellation.get('documents', []):
66 66 if doc_id in document.get('title', ''):
67 67 return document
  68 + for bid in data.get('bids', []):
  69 + for document in bid.get('documents', []):
  70 + if doc_id in document.get('title', ''):
  71 + return document
68 72 raise Exception('Document with id {} not found'.format(doc_id))
69 73
70 74
... ...
Please register or login to post a comment