Commit 4eb39ecf02eb6cb7dc0beca1813b3267a01cfcf1

Authored by kosaniak
Committed by GitHub
2 parents febf7a28 e0df68aa

Merge pull request #494 from ITVaan/test_for_proxy_server

Перевірка користувача по ЄДР
@@ -18,7 +18,7 @@ Library openprocurement_client_helper.py @@ -18,7 +18,7 @@ Library openprocurement_client_helper.py
18 18
19 Підготувати клієнт для користувача 19 Підготувати клієнт для користувача
20 [Arguments] ${username} 20 [Arguments] ${username}
21 - [Documentation] Відкрити браузер, створити об’єкт api wrapper, тощо 21 + [Documentation] Відкрити браузер, створити об’єкт api wrapper, створити об’єкт edr_wrapper, тощо
22 Log ${API_HOST_URL} 22 Log ${API_HOST_URL}
23 Log ${API_VERSION} 23 Log ${API_VERSION}
24 ${api_wrapper}= prepare_api_wrapper ${USERS.users['${username}'].api_key} ${API_HOST_URL} ${API_VERSION} 24 ${api_wrapper}= prepare_api_wrapper ${USERS.users['${username}'].api_key} ${API_HOST_URL} ${API_VERSION}
@@ -26,7 +26,10 @@ Library openprocurement_client_helper.py @@ -26,7 +26,10 @@ Library openprocurement_client_helper.py
26 Set To Dictionary ${USERS.users['${username}']} access_token=${EMPTY} 26 Set To Dictionary ${USERS.users['${username}']} access_token=${EMPTY}
27 ${id_map}= Create Dictionary 27 ${id_map}= Create Dictionary
28 Set To Dictionary ${USERS.users['${username}']} id_map=${id_map} 28 Set To Dictionary ${USERS.users['${username}']} id_map=${id_map}
29 - Log Variables 29 + Log ${EDR_HOST_URL}
  30 + Log ${EDR_VERSION}
  31 + ${edr_wrapper}= prepare_edr_wrapper ${EDR_HOST_URL} ${EDR_VERSION} ${USERS.users['${username}'].auth_edr[0]} ${USERS.users['${username}'].auth_edr[1]}
  32 + Set To Dictionary ${USERS.users['${username}']} edr_client=${edr_wrapper}
30 33
31 34
32 Завантажити документ 35 Завантажити документ
@@ -705,8 +708,16 @@ Library openprocurement_client_helper.py @@ -705,8 +708,16 @@ Library openprocurement_client_helper.py
705 # Bid operations 708 # Bid operations
706 ############################################################################## 709 ##############################################################################
707 710
  711 +Перевірити учасника за ЄДРПОУ
  712 + [Arguments] ${username} ${edrpou}
  713 + ${reply}= Call Method ${USERS.users['${username}'].edr_client} verify_member ${edrpou}
  714 + Log ${reply}
  715 +
  716 +
708 Подати цінову пропозицію 717 Подати цінову пропозицію
709 [Arguments] ${username} ${tender_uaid} ${bid} ${lots_ids}=${None} ${features_ids}=${None} 718 [Arguments] ${username} ${tender_uaid} ${bid} ${lots_ids}=${None} ${features_ids}=${None}
  719 + ${verify_response}= Run As ${username} Перевірити учасника за ЄДРПОУ ${bid.data.tenderers[0].identifier.id}
  720 + Log ${verify_response}
710 ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid} 721 ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid}
711 ${lots_ids}= Run Keyword IF ${lots_ids} Set Variable ${lots_ids} 722 ${lots_ids}= Run Keyword IF ${lots_ids} Set Variable ${lots_ids}
712 ... ELSE Create List 723 ... ELSE Create List
1 -from openprocurement_client.client import Client 1 +from openprocurement_client.client import Client, EDRClient
2 from openprocurement_client.utils import get_tender_id_by_uaid 2 from openprocurement_client.utils import get_tender_id_by_uaid
3 from openprocurement_client.exceptions import IdNotFound 3 from openprocurement_client.exceptions import IdNotFound
4 from restkit.errors import RequestFailed, BadStatusLine 4 from restkit.errors import RequestFailed, BadStatusLine
@@ -28,6 +28,17 @@ def prepare_api_wrapper(key, host_url, api_version): @@ -28,6 +28,17 @@ def prepare_api_wrapper(key, host_url, api_version):
28 return StableClient(key, host_url, api_version) 28 return StableClient(key, host_url, api_version)
29 29
30 30
  31 +class StableEDRClient(EDRClient):
  32 + @retry(stop_max_attempt_number=100, wait_random_min=500,
  33 + wait_random_max=4000, retry_on_exception=retry_if_request_failed)
  34 + def request(self, *args, **kwargs):
  35 + return super(StableEDRClient, self).request(*args, **kwargs)
  36 +
  37 +
  38 +def prepare_edr_wrapper(host_url, api_version, username, password):
  39 + return StableEDRClient(host_url, api_version, username, password)
  40 +
  41 +
31 def get_complaint_internal_id(tender, complaintID): 42 def get_complaint_internal_id(tender, complaintID):
32 try: 43 try:
33 for complaint in tender.data.complaints: 44 for complaint in tender.data.complaints:
@@ -2,19 +2,24 @@ users: @@ -2,19 +2,24 @@ users:
2 Tender_Owner: 2 Tender_Owner:
3 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3 3 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3
4 broker: Quinta 4 broker: Quinta
  5 + auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
5 Tender_User: 6 Tender_User:
6 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3 7 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3
7 broker: Quinta 8 broker: Quinta
  9 + auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
8 Tender_User1: 10 Tender_User1:
9 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3 11 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3
10 broker: Quinta 12 broker: Quinta
  13 + auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
11 Tender_User2: 14 Tender_User2:
12 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3 15 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3
13 broker: Quinta 16 broker: Quinta
  17 + auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
14 Tender_Viewer: 18 Tender_Viewer:
15 api_key: "" 19 api_key: ""
16 broker: Quinta 20 broker: Quinta
17 browser: firefox 21 browser: firefox
  22 + auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
18 Etender_Owner: 23 Etender_Owner:
19 broker: Etender 24 broker: Etender
20 homepage: "http://bid.uat.e-tender.biz/#/" 25 homepage: "http://bid.uat.e-tender.biz/#/"
@@ -3,3 +3,5 @@ ${API_HOST_URL} https://lb.api-sandbox.openprocurement.org @@ -3,3 +3,5 @@ ${API_HOST_URL} https://lb.api-sandbox.openprocurement.org
3 ${API_VERSION} 2.3 3 ${API_VERSION} 2.3
4 ${BROKER} Quinta 4 ${BROKER} Quinta
5 ${ROLE} viewer 5 ${ROLE} viewer
  6 +${EDR_HOST_URL} https://lb.edr-sandbox.openprocurement.org
  7 +${EDR_VERSION} 0
Please register or login to post a comment