Commit f1c32386844dc6c61414790fc6719869ff6a1be3

Authored by Leits
1 parent d5af4602

Add get tender id by uaid

@@ -10,13 +10,10 @@ Library openprocurement_client_helper.py @@ -10,13 +10,10 @@ Library openprocurement_client_helper.py
10 Log Many ${ID_MAP} 10 Log Many ${ID_MAP}
11 ${status}= Run Keyword And Return Status Dictionary Should Contain Key ${ID_MAP} ${tender_uaid} 11 ${status}= Run Keyword And Return Status Dictionary Should Contain Key ${ID_MAP} ${tender_uaid}
12 Run Keyword And Return If ${status} Get From Dictionary ${ID_MAP} ${tender_uaid} 12 Run Keyword And Return If ${status} Get From Dictionary ${ID_MAP} ${tender_uaid}
13 - ${tenders}= get_tenders ${USERS.users['${username}'].client}  
14 - Log Many @{tenders}  
15 - :FOR ${tender} IN @{tenders}  
16 - \ Set To Dictionary ${ID_MAP} ${tender.tenderID} ${tender.id}  
17 - Log Many ${ID_MAP}  
18 - Dictionary Should Contain Key ${ID_MAP} ${tender_uaid}  
19 - Run Keyword And Return Get From Dictionary ${ID_MAP} ${tender_uaid} 13 + ${tender_id}= get_tender_id_by_uaid ${tender_uaid} ${USERS.users['${username}'].client}
  14 + Set To Dictionary ${ID_MAP} ${tender_uaid} ${tender_id}
  15 + [return] ${tender_id}
  16 +
20 17
21 18
22 Підготувати клієнт для користувача 19 Підготувати клієнт для користувача
1 from openprocurement_client.client import Client 1 from openprocurement_client.client import Client
  2 +from openprocurement_client.utils import get_tender_id_by_uaid
2 3
3 4
4 def prepare_api_wrapper(key, host_url, api_version): 5 def prepare_api_wrapper(key, host_url, api_version):
5 return Client(key, host_url, api_version) 6 return Client(key, host_url, api_version)
6 -  
7 -  
8 -def get_tenders(client, offset=None):  
9 - params = {'opt_fields': 'tenderID', 'descending': 1}  
10 - if offset:  
11 - params['offset'] = offset  
12 - return client.get_tenders(params)  
Please register or login to post a comment