Commit 6c7f1ea4ff39d0584666b8ffe7c6e50cb270abec

Authored by alexdiatlov
Committed by GitHub
2 parents 05285c97 98b2b6b1

Merge pull request #127 from ProzorroUKR/dasu_user

Dasu user/MPC validation
@@ -72,7 +72,13 @@ Library openprocurement_client.utils @@ -72,7 +72,13 @@ Library openprocurement_client.utils
72 ${api_wrapper}= Run Keyword If '${RESOURCE}' == 'plans' 72 ${api_wrapper}= Run Keyword If '${RESOURCE}' == 'plans'
73 ... prepare_plan_api_wrapper ${USERS.users['${username}'].api_key} PLANS ${API_HOST_URL} ${API_VERSION} 73 ... prepare_plan_api_wrapper ${USERS.users['${username}'].api_key} PLANS ${API_HOST_URL} ${API_VERSION}
74 ... ELSE prepare_api_wrapper ${USERS.users['${username}'].api_key} ${RESOURCE} ${API_HOST_URL} ${API_VERSION} ${ds_config} 74 ... ELSE prepare_api_wrapper ${USERS.users['${username}'].api_key} ${RESOURCE} ${API_HOST_URL} ${API_VERSION} ${ds_config}
75 - ${dasu_api_wraper}= prepare_dasu_api_wrapper ${USERS.users['${username}'].dasu_api_key} ${DASU_RESOURCE} ${DASU_API_HOST_URL} ${DASU_API_VERSION} ${ds_config} 75 + ${dasu_api_wraper}= prepare_dasu_api_wrapper
  76 + ... ${DASU_RESOURCE}
  77 + ... ${DASU_API_HOST_URL}
  78 + ... ${DASU_API_VERSION}
  79 + ... ${USERS.users['${username}'].auth_dasu[0]}
  80 + ... ${USERS.users['${username}'].auth_dasu[1]}
  81 + ... ${ds_config}
76 ${agreement_wrapper}= prepare_agreement_api_wrapper ${USERS.users['${username}'].api_key} AGREEMENTS ${API_HOST_URL} ${API_VERSION} ${ds_config} 82 ${agreement_wrapper}= prepare_agreement_api_wrapper ${USERS.users['${username}'].api_key} AGREEMENTS ${API_HOST_URL} ${API_VERSION} ${ds_config}
77 Set To Dictionary ${USERS.users['${username}']} client=${api_wrapper} 83 Set To Dictionary ${USERS.users['${username}']} client=${api_wrapper}
78 Set To Dictionary ${USERS.users['${username}']} agreement_client=${agreement_wrapper} 84 Set To Dictionary ${USERS.users['${username}']} agreement_client=${agreement_wrapper}
@@ -12,6 +12,7 @@ from time import sleep @@ -12,6 +12,7 @@ from time import sleep
12 import os 12 import os
13 import urllib 13 import urllib
14 14
  15 +
15 def retry_if_request_failed(exception): 16 def retry_if_request_failed(exception):
16 status_code = getattr(exception, 'status_code', None) 17 status_code = getattr(exception, 'status_code', None)
17 print(status_code) 18 print(status_code)
@@ -146,6 +147,7 @@ def get_contracts_feed(client, interval=0.5): @@ -146,6 +147,7 @@ def get_contracts_feed(client, interval=0.5):
146 for item in get_items_feed(client, 'get_contracts', interval): 147 for item in get_items_feed(client, 'get_contracts', interval):
147 yield item 148 yield item
148 149
  150 +
149 def get_items_feed(client, client_method, interval=0.5): 151 def get_items_feed(client, client_method, interval=0.5):
150 items = True 152 items = True
151 while items: 153 while items:
@@ -179,6 +181,5 @@ class StableClient_dasu(DasuClient): @@ -179,6 +181,5 @@ class StableClient_dasu(DasuClient):
179 return super(StableClient_dasu, self).request(*args, **kwargs) 181 return super(StableClient_dasu, self).request(*args, **kwargs)
180 182
181 183
182 -def prepare_dasu_api_wrapper(key, resource, host_url, api_version, ds_config=None):  
183 - return StableClient_dasu(key, resource, host_url, api_version,  
184 - ds_config=ds_config)  
  184 +def prepare_dasu_api_wrapper(resource, host_url, api_version, username, password, ds_config=None):
  185 + return StableClient_dasu(resource, host_url, api_version, username, password, ds_config=ds_config)
@@ -5,7 +5,7 @@ users: @@ -5,7 +5,7 @@ users:
5 plans: [test.quintagroup.com, test.quintagroup.com] 5 plans: [test.quintagroup.com, test.quintagroup.com]
6 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548] 6 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548]
7 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3 7 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3
8 - dasu_api_key: e9c3ccb8e8124f26941d5f9639a4ebc3 8 + auth_dasu: [test.quintagroup.com, e9c3ccb8e8124f26941d5f9639a4ebc3]
9 broker: Quinta 9 broker: Quinta
10 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62] 10 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
11 browser: phantomjs 11 browser: phantomjs
@@ -17,7 +17,7 @@ users: @@ -17,7 +17,7 @@ users:
17 plans: [test.quintagroup.com, test.quintagroup.com] 17 plans: [test.quintagroup.com, test.quintagroup.com]
18 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548] 18 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548]
19 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3 19 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3
20 - dasu_api_key: "" 20 + auth_dasu: [test.quintagroup.com, e9c3ccb8e8124f26941d5f9639a4ebc3]
21 broker: Quinta 21 broker: Quinta
22 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62] 22 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
23 browser: phantomjs 23 browser: phantomjs
@@ -29,7 +29,7 @@ users: @@ -29,7 +29,7 @@ users:
29 plans: [test.quintagroup.com, test.quintagroup.com] 29 plans: [test.quintagroup.com, test.quintagroup.com]
30 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548] 30 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548]
31 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3 31 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3
32 - dasu_api_key: "" 32 + auth_dasu: [test.quintagroup.com, e9c3ccb8e8124f26941d5f9639a4ebc3]
33 broker: Quinta 33 broker: Quinta
34 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62] 34 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
35 browser: phantomjs 35 browser: phantomjs
@@ -41,7 +41,7 @@ users: @@ -41,7 +41,7 @@ users:
41 plans: [test.quintagroup.com, test.quintagroup.com] 41 plans: [test.quintagroup.com, test.quintagroup.com]
42 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548] 42 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548]
43 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3 43 api_key: e9c3ccb8e8124f26941d5f9639a4ebc3
44 - dasu_api_key: "" 44 + auth_dasu: [test.quintagroup.com, e9c3ccb8e8124f26941d5f9639a4ebc3]
45 broker: Quinta 45 broker: Quinta
46 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62] 46 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
47 browser: phantomjs 47 browser: phantomjs
@@ -54,7 +54,7 @@ users: @@ -54,7 +54,7 @@ users:
54 monitorings: [test.quintagroup.com, test.quintagroup.com] 54 monitorings: [test.quintagroup.com, test.quintagroup.com]
55 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548] 55 auctions: [test.quintagroup.com, bc698baa8b814908bc75405ed3d63548]
56 api_key: "" 56 api_key: ""
57 - dasu_api_key: "" 57 + auth_dasu: [test.quintagroup.com, e9c3ccb8e8124f26941d5f9639a4ebc3]
58 broker: Quinta 58 broker: Quinta
59 browser: chrome 59 browser: chrome
60 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62] 60 auth_edr: [test.quintagroup.com, f5111c99a97a45348d8165ba8fcf0d62]
@@ -65,7 +65,7 @@ users: @@ -65,7 +65,7 @@ users:
65 monitorings: [test.quintagroup.com, test.quintagroup.com] 65 monitorings: [test.quintagroup.com, test.quintagroup.com]
66 plans: [test.quintagroup.com, test.quintagroup.com] 66 plans: [test.quintagroup.com, test.quintagroup.com]
67 tenders: [test.quintagroup.com, test.quintagroup.com] 67 tenders: [test.quintagroup.com, test.quintagroup.com]
68 - dasu_api_key: 9987b551710b44699bf2ad10188bcf65 68 + auth_dasu: [robot_test_sas, 9987b551710b44699bf2ad10188bcf65]
69 api_key: 9987b551710b44699bf2ad10188bcf65 69 api_key: 9987b551710b44699bf2ad10188bcf65
70 broker: Quinta 70 broker: Quinta
71 browser: phantomjs 71 browser: phantomjs
@@ -172,7 +172,6 @@ def test_tender_data(params, @@ -172,7 +172,6 @@ def test_tender_data(params,
172 data = { 172 data = {
173 "mode": "test", 173 "mode": "test",
174 "submissionMethodDetails": submissionMethodDetails, 174 "submissionMethodDetails": submissionMethodDetails,
175 - "mainProcurementCategory": fake.random_element(('goods', 'services', 'works')),  
176 "description": fake.description(), 175 "description": fake.description(),
177 "description_en": fake_en.sentence(nb_words=10, variable_nb_words=True), 176 "description_en": fake_en.sentence(nb_words=10, variable_nb_words=True),
178 "description_ru": fake_ru.sentence(nb_words=10, variable_nb_words=True), 177 "description_ru": fake_ru.sentence(nb_words=10, variable_nb_words=True),
@@ -193,6 +192,12 @@ def test_tender_data(params, @@ -193,6 +192,12 @@ def test_tender_data(params,
193 "items": [], 192 "items": [],
194 "features": [] 193 "features": []
195 } 194 }
  195 + if params.get("mode") == "open_framework":
  196 + data["mainProcurementCategory"] = random.choice(['goods', 'services'])
  197 + elif params.get("mode") == "open_competitive_dialogue":
  198 + data["mainProcurementCategory"] = random.choice(['services', 'works'])
  199 + else:
  200 + data["mainProcurementCategory"] = random.choice(['goods', 'services', 'works'])
196 accelerator = accelerator \ 201 accelerator = accelerator \
197 if accelerator else params['intervals']['accelerator'] 202 if accelerator else params['intervals']['accelerator']
198 data['procurementMethodDetails'] = 'quick, ' \ 203 data['procurementMethodDetails'] = 'quick, ' \
Please register or login to post a comment