Commit 39371f64e3ef9491d980f3aff8c76dad83c298c7
Committed by
GitHub
Merge pull request #146 from ProzorroUKR/dev_prozorro
Dev prozorro
Showing
16 changed files
with
324 additions
and
76 deletions
@@ -9,6 +9,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -9,6 +9,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
9 | 9 | ||
10 | *** Keywords *** | 10 | *** Keywords *** |
11 | Можливість оголосити тендер | 11 | Можливість оголосити тендер |
12 | + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml | ||
13 | + ${ARTIFACT}= load_data_from ${file_path} | ||
14 | + Log ${ARTIFACT.tender_uaid} | ||
12 | ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS} | 15 | ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS} |
13 | ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} | 16 | ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} |
14 | ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES} | 17 | ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES} |
@@ -25,11 +28,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -25,11 +28,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
25 | ... vat_included=${${VAT_INCLUDED}} | 28 | ... vat_included=${${VAT_INCLUDED}} |
26 | ... road_index=${${ROAD_INDEX}} | 29 | ... road_index=${${ROAD_INDEX}} |
27 | ... gmdn_index=${${GMDN_INDEX}} | 30 | ... gmdn_index=${${GMDN_INDEX}} |
31 | + ... plan_tender=${${PLAN_TENDER}} | ||
28 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} | 32 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} |
29 | ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND} | 33 | ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND} |
30 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} | 34 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} |
31 | Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND} | 35 | Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND} |
32 | - ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} | 36 | + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid} |
37 | + Log ${plan_data} | ||
38 | + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data} | ||
33 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} | 39 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} |
34 | ${TENDER_UAID}= Run As ${tender_owner} Створити тендер ${adapted_data} | 40 | ${TENDER_UAID}= Run As ${tender_owner} Створити тендер ${adapted_data} |
35 | Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data} | 41 | Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data} |
@@ -62,6 +68,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -62,6 +68,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
62 | 68 | ||
63 | 69 | ||
64 | Можливість оголосити тендер з використанням валідації для MNN | 70 | Можливість оголосити тендер з використанням валідації для MNN |
71 | + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml | ||
72 | + ${ARTIFACT}= load_data_from ${file_path} | ||
73 | + Log ${ARTIFACT.tender_uaid} | ||
65 | [Arguments] ${data_version} | 74 | [Arguments] ${data_version} |
66 | ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS} | 75 | ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS} |
67 | ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} | 76 | ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} |
@@ -78,11 +87,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -78,11 +87,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
78 | ... moz_integration=${${MOZ_INTEGRATION}} | 87 | ... moz_integration=${${MOZ_INTEGRATION}} |
79 | ... road_index=${${ROAD_INDEX}} | 88 | ... road_index=${${ROAD_INDEX}} |
80 | ... gmdn_index=${${GMDN_INDEX}} | 89 | ... gmdn_index=${${GMDN_INDEX}} |
90 | + ... plan_tender=${${PLAN_TENDER}} | ||
81 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} | 91 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} |
82 | ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND} | 92 | ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND} |
83 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} | 93 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} |
84 | Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND} | 94 | Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND} |
85 | - ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} | 95 | + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid} |
96 | + Log ${plan_data} | ||
97 | + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data} | ||
86 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} | 98 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} |
87 | ${adapted_data_mnn}= edit_tender_data_for_mnn ${adapted_data} ${MODE} ${data_version} | 99 | ${adapted_data_mnn}= edit_tender_data_for_mnn ${adapted_data} ${MODE} ${data_version} |
88 | Log ${adapted_data_mnn} | 100 | Log ${adapted_data_mnn} |
@@ -93,6 +105,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -93,6 +105,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
93 | 105 | ||
94 | Можливість оголосити тендер з використанням валідації Індекс автомобільних доріг | 106 | Можливість оголосити тендер з використанням валідації Індекс автомобільних доріг |
95 | [Arguments] ${data_version} | 107 | [Arguments] ${data_version} |
108 | + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml | ||
109 | + ${ARTIFACT}= load_data_from ${file_path} | ||
110 | + Log ${ARTIFACT.tender_uaid} | ||
96 | ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS} | 111 | ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS} |
97 | ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} | 112 | ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} |
98 | ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES} | 113 | ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES} |
@@ -108,11 +123,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -108,11 +123,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
108 | ... moz_integration=${${MOZ_INTEGRATION}} | 123 | ... moz_integration=${${MOZ_INTEGRATION}} |
109 | ... road_index=${${ROAD_INDEX}} | 124 | ... road_index=${${ROAD_INDEX}} |
110 | ... gmdn_index=${${GMDN_INDEX}} | 125 | ... gmdn_index=${${GMDN_INDEX}} |
126 | + ... plan_tender=${${PLAN_TENDER}} | ||
111 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} | 127 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} |
112 | ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND} | 128 | ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND} |
113 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} | 129 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} |
114 | Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND} | 130 | Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND} |
115 | - ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} | 131 | + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid} |
132 | + Log ${plan_data} | ||
133 | + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data} | ||
116 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} | 134 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} |
117 | ${adapted_data_cost}= edit_tender_data_for_cost ${adapted_data} ${MODE} ${data_version} | 135 | ${adapted_data_cost}= edit_tender_data_for_cost ${adapted_data} ${MODE} ${data_version} |
118 | Log ${adapted_data_cost} | 136 | Log ${adapted_data_cost} |
@@ -123,6 +141,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -123,6 +141,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
123 | 141 | ||
124 | Можливість оголосити тендер з використанням валідації класифікатор медичних виробів | 142 | Можливість оголосити тендер з використанням валідації класифікатор медичних виробів |
125 | [Arguments] ${data_version} | 143 | [Arguments] ${data_version} |
144 | + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml | ||
145 | + ${ARTIFACT}= load_data_from ${file_path} | ||
146 | + Log ${ARTIFACT.tender_uaid} | ||
126 | ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS} | 147 | ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS} |
127 | ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} | 148 | ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} |
128 | ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES} | 149 | ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES} |
@@ -138,11 +159,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -138,11 +159,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
138 | ... moz_integration=${${MOZ_INTEGRATION}} | 159 | ... moz_integration=${${MOZ_INTEGRATION}} |
139 | ... road_index=${${ROAD_INDEX}} | 160 | ... road_index=${${ROAD_INDEX}} |
140 | ... gmdn_index=${${GMDN_INDEX}} | 161 | ... gmdn_index=${${GMDN_INDEX}} |
162 | + ... plan_tender=${${PLAN_TENDER}} | ||
141 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} | 163 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} |
142 | ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND} | 164 | ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND} |
143 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} | 165 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} |
144 | Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND} | 166 | Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND} |
145 | - ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} | 167 | + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid} |
168 | + Log ${plan_data} | ||
169 | + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data} | ||
146 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} | 170 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} |
147 | ${adapted_data_gmdn}= edit_tender_data_for_gmdn ${adapted_data} ${MODE} ${data_version} | 171 | ${adapted_data_gmdn}= edit_tender_data_for_gmdn ${adapted_data} ${MODE} ${data_version} |
148 | Log ${adapted_data_gmdn} | 172 | Log ${adapted_data_gmdn} |
@@ -151,6 +175,42 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -151,6 +175,42 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
151 | Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID} | 175 | Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID} |
152 | 176 | ||
153 | 177 | ||
178 | +Можливість оголосити тендер з використанням валідації план-тендер | ||
179 | + [Arguments] ${data_version} | ||
180 | + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml | ||
181 | + ${ARTIFACT}= load_data_from ${file_path} | ||
182 | + Log ${ARTIFACT.tender_uaid} | ||
183 | + ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS} | ||
184 | + ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} | ||
185 | + ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES} | ||
186 | + ${tender_parameters}= Create Dictionary | ||
187 | + ... mode=${MODE} | ||
188 | + ... number_of_items=${NUMBER_OF_ITEMS} | ||
189 | + ... number_of_lots=${NUMBER_OF_LOTS} | ||
190 | + ... number_of_milestones=${NUMBER_OF_MILESTONES} | ||
191 | + ... tender_meat=${${TENDER_MEAT}} | ||
192 | + ... lot_meat=${${LOT_MEAT}} | ||
193 | + ... item_meat=${${ITEM_MEAT}} | ||
194 | + ... api_host_url=${API_HOST_URL} | ||
195 | + ... moz_integration=${${MOZ_INTEGRATION}} | ||
196 | + ... road_index=${${ROAD_INDEX}} | ||
197 | + ... gmdn_index=${${GMDN_INDEX}} | ||
198 | + ... plan_tender=${${PLAN_TENDER}} | ||
199 | + ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} | ||
200 | + ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND} | ||
201 | + Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} | ||
202 | + Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND} | ||
203 | + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid} | ||
204 | + Log ${plan_data} | ||
205 | + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data} | ||
206 | + ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} | ||
207 | + ${adapted_data_plan_tender}= edit_tender_data_for_plan_tender ${adapted_data} ${MODE} ${data_version} | ||
208 | + Log ${adapted_data_plan_tender} | ||
209 | + ${TENDER_UAID}= Run As ${tender_owner} Створити тендер ${adapted_data_plan_tender} | ||
210 | + Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data_plan_tender} | ||
211 | + Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID} | ||
212 | + | ||
213 | + | ||
154 | Можливість створити об'єкт моніторингу | 214 | Можливість створити об'єкт моніторингу |
155 | ${period_intervals}= compute_intrs ${BROKERS} ${used_brokers} | 215 | ${period_intervals}= compute_intrs ${BROKERS} ${used_brokers} |
156 | ${accelerator}= Get Variable Value ${accelerator} | 216 | ${accelerator}= Get Variable Value ${accelerator} |
@@ -182,6 +242,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -182,6 +242,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
182 | ... number_of_items=${NUMBER_OF_ITEMS} | 242 | ... number_of_items=${NUMBER_OF_ITEMS} |
183 | ... tender_meat=${${TENDER_MEAT}} | 243 | ... tender_meat=${${TENDER_MEAT}} |
184 | ... item_meat=${${ITEM_MEAT}} | 244 | ... item_meat=${${ITEM_MEAT}} |
245 | + ... moz_integration=${${MOZ_INTEGRATION}} | ||
246 | + ... road_index=${${ROAD_INDEX}} | ||
247 | + ... gmdn_index=${${GMDN_INDEX}} | ||
185 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} | 248 | ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} |
186 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} | 249 | Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} |
187 | ${tender_data}= Підготувати дані для створення плану ${tender_parameters} | 250 | ${tender_data}= Підготувати дані для створення плану ${tender_parameters} |
@@ -191,6 +254,26 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | @@ -191,6 +254,26 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status": | ||
191 | Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID} | 254 | Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID} |
192 | 255 | ||
193 | 256 | ||
257 | +Можливість створити план закупівлі з використанням валідації для buyers | ||
258 | + [Arguments] ${data_version} | ||
259 | + ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS} | ||
260 | + ${tender_parameters}= Create Dictionary | ||
261 | + ... mode=${MODE} | ||
262 | + ... number_of_items=${NUMBER_OF_ITEMS} | ||
263 | + ... tender_meat=${${TENDER_MEAT}} | ||
264 | + ... item_meat=${${ITEM_MEAT}} | ||
265 | + ... moz_integration=${${MOZ_INTEGRATION}} | ||
266 | + ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE} | ||
267 | + Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE} | ||
268 | + ${tender_data}= Підготувати дані для створення плану ${tender_parameters} | ||
269 | + ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data} | ||
270 | + ${adapted_data_buyers}= edit_plan_buyers ${adapted_data} ${data_version} | ||
271 | + Log ${adapted_data_buyers} | ||
272 | + ${TENDER_UAID}= Run As ${tender_owner} Створити план ${adapted_data_buyers} | ||
273 | + Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data_buyers} | ||
274 | + Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID} | ||
275 | + | ||
276 | + | ||
194 | Можливість знайти тендер по ідентифікатору для усіх користувачів | 277 | Можливість знайти тендер по ідентифікатору для усіх користувачів |
195 | :FOR ${username} IN ${tender_owner} ${provider} ${provider1} ${provider2} ${viewer} | 278 | :FOR ${username} IN ${tender_owner} ${provider} ${provider1} ${provider2} ${viewer} |
196 | \ Можливість знайти тендер по ідентифікатору для користувача ${username} | 279 | \ Можливість знайти тендер по ідентифікатору для користувача ${username} |
@@ -24,8 +24,8 @@ Library openprocurement_client.utils | @@ -24,8 +24,8 @@ Library openprocurement_client.utils | ||
24 | Log Many ${USERS.users['${username}'].id_map} | 24 | Log Many ${USERS.users['${username}'].id_map} |
25 | ${status}= Run Keyword And Return Status Dictionary Should Contain Key ${USERS.users['${username}'].id_map} ${tender_uaid} | 25 | ${status}= Run Keyword And Return Status Dictionary Should Contain Key ${USERS.users['${username}'].id_map} ${tender_uaid} |
26 | Run Keyword And Return If ${status} Get From Dictionary ${USERS.users['${username}'].id_map} ${tender_uaid} | 26 | Run Keyword And Return If ${status} Get From Dictionary ${USERS.users['${username}'].id_map} ${tender_uaid} |
27 | - Call Method ${USERS.users['${username}'].client} get_plans | ||
28 | - ${tender_id}= Wait Until Keyword Succeeds 5x 30 sec get_plan_id_by_uaid ${tender_uaid} ${USERS.users['${username}'].client} | 27 | + Call Method ${USERS.users['${username}'].plan_client} get_plans |
28 | + ${tender_id}= Wait Until Keyword Succeeds 5x 30 sec get_plan_id_by_uaid ${tender_uaid} ${USERS.users['${username}'].plan_client} | ||
29 | Set To Dictionary ${USERS.users['${username}'].id_map} ${tender_uaid} ${tender_id} | 29 | Set To Dictionary ${USERS.users['${username}'].id_map} ${tender_uaid} ${tender_id} |
30 | [return] ${tender_id} | 30 | [return] ${tender_id} |
31 | 31 | ||
@@ -69,9 +69,14 @@ Library openprocurement_client.utils | @@ -69,9 +69,14 @@ Library openprocurement_client.utils | ||
69 | Log ${auth_ds} | 69 | Log ${auth_ds} |
70 | 70 | ||
71 | ${ds_config}= Create Dictionary host_url=${ds_host_url} auth_ds=${auth_ds} | 71 | ${ds_config}= Create Dictionary host_url=${ds_host_url} auth_ds=${auth_ds} |
72 | - ${api_wrapper}= Run Keyword If '${RESOURCE}' == 'plans' | ||
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} | 72 | + ${plan_api_wrapper}= prepare_plan_api_wrapper ${USERS.users['${username}'].api_key} PLANS ${API_HOST_URL} ${API_VERSION} |
73 | + ${tender_api_wrapper}= prepare_api_wrapper ${USERS.users['${username}'].api_key} TENDERS ${API_HOST_URL} ${API_VERSION} ${ds_config} | ||
74 | + ${tender_create_wrapper}= prepare_tender_create_wrapper | ||
75 | + ... ${USERS.users['${username}'].api_key} | ||
76 | + ... PLANS | ||
77 | + ... ${API_HOST_URL} | ||
78 | + ... ${API_VERSION} | ||
79 | + ... ${ds_config} | ||
75 | ${dasu_api_wraper}= prepare_dasu_api_wrapper | 80 | ${dasu_api_wraper}= prepare_dasu_api_wrapper |
76 | ... ${DASU_RESOURCE} | 81 | ... ${DASU_RESOURCE} |
77 | ... ${DASU_API_HOST_URL} | 82 | ... ${DASU_API_HOST_URL} |
@@ -80,7 +85,9 @@ Library openprocurement_client.utils | @@ -80,7 +85,9 @@ Library openprocurement_client.utils | ||
80 | ... ${USERS.users['${username}'].auth_dasu[1]} | 85 | ... ${USERS.users['${username}'].auth_dasu[1]} |
81 | ... ${ds_config} | 86 | ... ${ds_config} |
82 | ${agreement_wrapper}= prepare_agreement_api_wrapper ${USERS.users['${username}'].api_key} AGREEMENTS ${API_HOST_URL} ${API_VERSION} ${ds_config} | 87 | ${agreement_wrapper}= prepare_agreement_api_wrapper ${USERS.users['${username}'].api_key} AGREEMENTS ${API_HOST_URL} ${API_VERSION} ${ds_config} |
83 | - Set To Dictionary ${USERS.users['${username}']} client=${api_wrapper} | 88 | + Set To Dictionary ${USERS.users['${username}']} client=${tender_api_wrapper} |
89 | + Set To Dictionary ${USERS.users['${username}']} plan_client=${plan_api_wrapper} | ||
90 | + Set To Dictionary ${USERS.users['${username}']} tender_create_client=${tender_create_wrapper} | ||
84 | Set To Dictionary ${USERS.users['${username}']} agreement_client=${agreement_wrapper} | 91 | Set To Dictionary ${USERS.users['${username}']} agreement_client=${agreement_wrapper} |
85 | Set To Dictionary ${USERS.users['${username}']} dasu_client=${dasu_api_wraper} | 92 | Set To Dictionary ${USERS.users['${username}']} dasu_client=${dasu_api_wraper} |
86 | Set To Dictionary ${USERS.users['${username}']} access_token=${EMPTY} | 93 | Set To Dictionary ${USERS.users['${username}']} access_token=${EMPTY} |
@@ -183,7 +190,14 @@ Library openprocurement_client.utils | @@ -183,7 +190,14 @@ Library openprocurement_client.utils | ||
183 | 190 | ||
184 | Створити тендер | 191 | Створити тендер |
185 | [Arguments] ${username} ${tender_data} | 192 | [Arguments] ${username} ${tender_data} |
186 | - ${tender}= Call Method ${USERS.users['${username}'].client} create_tender ${tender_data} | 193 | + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml |
194 | + ${ARTIFACT}= load_data_from ${file_path} | ||
195 | + Log ${ARTIFACT.tender_owner_access_token} | ||
196 | + Log ${ARTIFACT.tender_id} | ||
197 | + ${tender}= Call Method ${USERS.users['${username}'].tender_create_client} create_tender | ||
198 | + ... ${ARTIFACT.tender_id} | ||
199 | + ... ${tender_data} | ||
200 | + ... access_token=${ARTIFACT.tender_owner_access_token} | ||
187 | Log ${tender} | 201 | Log ${tender} |
188 | ${access_token}= Get Variable Value ${tender.access.token} | 202 | ${access_token}= Get Variable Value ${tender.access.token} |
189 | ${status}= Set Variable If 'open' in '${MODE}' active.tendering ${EMPTY} | 203 | ${status}= Set Variable If 'open' in '${MODE}' active.tendering ${EMPTY} |
@@ -232,10 +246,10 @@ Library openprocurement_client.utils | @@ -232,10 +246,10 @@ Library openprocurement_client.utils | ||
232 | 246 | ||
233 | Створити план | 247 | Створити план |
234 | [Arguments] ${username} ${tender_data} | 248 | [Arguments] ${username} ${tender_data} |
235 | - ${tender}= Call Method ${USERS.users['${username}'].client} create_plan ${tender_data} | 249 | + ${tender}= Call Method ${USERS.users['${username}'].plan_client} create_plan ${tender_data} |
236 | Log ${tender} | 250 | Log ${tender} |
237 | ${access_token}= Get Variable Value ${tender.access.token} | 251 | ${access_token}= Get Variable Value ${tender.access.token} |
238 | - ${tender}= Call Method ${USERS.users['${username}'].client} patch_plan | 252 | + ${tender}= Call Method ${USERS.users['${username}'].plan_client} patch_plan |
239 | ... ${tender.data.id} | 253 | ... ${tender.data.id} |
240 | ... ${tender} | 254 | ... ${tender} |
241 | ... access_token=${tender.access.token} | 255 | ... access_token=${tender.access.token} |
@@ -399,13 +413,13 @@ Library openprocurement_client.utils | @@ -399,13 +413,13 @@ Library openprocurement_client.utils | ||
399 | 413 | ||
400 | Отримати список планів | 414 | Отримати список планів |
401 | [Arguments] ${username} | 415 | [Arguments] ${username} |
402 | - @{plans_feed}= get_plans_feed ${USERS.users['${username}'].client} | 416 | + @{plans_feed}= get_plans_feed ${USERS.users['${username}'].plan_client} |
403 | [return] @{plans_feed} | 417 | [return] @{plans_feed} |
404 | 418 | ||
405 | 419 | ||
406 | Отримати план по внутрішньому ідентифікатору | 420 | Отримати план по внутрішньому ідентифікатору |
407 | [Arguments] ${username} ${internalid} ${save_key}=tender_data | 421 | [Arguments] ${username} ${internalid} ${save_key}=tender_data |
408 | - ${tender}= Call Method ${USERS.users['${username}'].client} get_plan ${internalid} | 422 | + ${tender}= Call Method ${USERS.users['${username}'].plan_client} get_plan ${internalid} |
409 | ${tender}= set_access_key ${tender} ${USERS.users['${username}'].access_token} | 423 | ${tender}= set_access_key ${tender} ${USERS.users['${username}'].access_token} |
410 | Set To Dictionary ${USERS.users['${username}']} ${save_key}=${tender} | 424 | Set To Dictionary ${USERS.users['${username}']} ${save_key}=${tender} |
411 | ${tender}= munch_dict arg=${tender} | 425 | ${tender}= munch_dict arg=${tender} |
@@ -512,7 +526,7 @@ Library openprocurement_client.utils | @@ -512,7 +526,7 @@ Library openprocurement_client.utils | ||
512 | ${tender}= openprocurement_client.Пошук плану по ідентифікатору ${username} ${tender_uaid} | 526 | ${tender}= openprocurement_client.Пошук плану по ідентифікатору ${username} ${tender_uaid} |
513 | Set_To_Object ${tender.data} ${fieldname} ${fieldvalue} | 527 | Set_To_Object ${tender.data} ${fieldname} ${fieldvalue} |
514 | ${tender}= set_access_key ${tender} ${USERS.users['${username}'].access_token} | 528 | ${tender}= set_access_key ${tender} ${USERS.users['${username}'].access_token} |
515 | - ${tender}= Call Method ${USERS.users['${username}'].client} patch_plan | 529 | + ${tender}= Call Method ${USERS.users['${username}'].plan_client} patch_plan |
516 | ... ${tender.data.id} | 530 | ... ${tender.data.id} |
517 | ... ${tender} | 531 | ... ${tender} |
518 | ... access_token=${tender.access.token} | 532 | ... access_token=${tender.access.token} |
@@ -536,11 +550,12 @@ Library openprocurement_client.utils | @@ -536,11 +550,12 @@ Library openprocurement_client.utils | ||
536 | [Arguments] ${username} ${tender_uaid} ${item} | 550 | [Arguments] ${username} ${tender_uaid} ${item} |
537 | ${tender}= openprocurement_client.Пошук плану по ідентифікатору ${username} ${tender_uaid} | 551 | ${tender}= openprocurement_client.Пошук плану по ідентифікатору ${username} ${tender_uaid} |
538 | Append To List ${tender.data['items']} ${item} | 552 | Append To List ${tender.data['items']} ${item} |
539 | - Call Method ${USERS.users['${username}'].client} patch_plan | 553 | + Call Method ${USERS.users['${username}'].plan_client} patch_plan |
540 | ... ${tender.data.id} | 554 | ... ${tender.data.id} |
541 | ... ${tender} | 555 | ... ${tender} |
542 | ... access_token=${tender.access.token} | 556 | ... access_token=${tender.access.token} |
543 | 557 | ||
558 | + | ||
544 | Отримати інформацію із предмету | 559 | Отримати інформацію із предмету |
545 | [Arguments] ${username} ${tender_uaid} ${item_id} ${field_name} | 560 | [Arguments] ${username} ${tender_uaid} ${item_id} ${field_name} |
546 | ${field_name}= Отримати шлях до поля об’єкта ${username} ${field_name} ${item_id} | 561 | ${field_name}= Отримати шлях до поля об’єкта ${username} ${field_name} ${item_id} |
@@ -563,7 +578,7 @@ Library openprocurement_client.utils | @@ -563,7 +578,7 @@ Library openprocurement_client.utils | ||
563 | ${tender}= openprocurement_client.Пошук плану по ідентифікатору ${username} ${tender_uaid} | 578 | ${tender}= openprocurement_client.Пошук плану по ідентифікатору ${username} ${tender_uaid} |
564 | ${item_index}= get_object_index_by_id ${tender.data['items']} ${item_id} | 579 | ${item_index}= get_object_index_by_id ${tender.data['items']} ${item_id} |
565 | Remove From List ${tender.data['items']} ${item_index} | 580 | Remove From List ${tender.data['items']} ${item_index} |
566 | - Call Method ${USERS.users['${username}'].client} patch_plan | 581 | + Call Method ${USERS.users['${username}'].plan_client} patch_plan |
567 | ... ${tender.data.id} | 582 | ... ${tender.data.id} |
568 | ... ${tender} | 583 | ... ${tender} |
569 | ... access_token=${tender.access.token} | 584 | ... access_token=${tender.access.token} |
@@ -11,6 +11,7 @@ from retrying import retry | @@ -11,6 +11,7 @@ from retrying import retry | ||
11 | from time import sleep | 11 | from time import sleep |
12 | import os | 12 | import os |
13 | import urllib | 13 | import urllib |
14 | +from openprocurement_client.resources.tenders import TenderCreateClient | ||
14 | 15 | ||
15 | 16 | ||
16 | def retry_if_request_failed(exception): | 17 | def retry_if_request_failed(exception): |
@@ -182,4 +183,16 @@ class StableClient_dasu(DasuClient): | @@ -182,4 +183,16 @@ class StableClient_dasu(DasuClient): | ||
182 | 183 | ||
183 | 184 | ||
184 | def prepare_dasu_api_wrapper(resource, host_url, api_version, username, password, ds_config=None): | 185 | 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) | ||
186 | + return StableClient_dasu(resource, host_url, api_version, username, password, ds_config=ds_config) | ||
187 | + | ||
188 | + | ||
189 | +class StableTenderCreateClient(TenderCreateClient): | ||
190 | + @retry(stop_max_attempt_number=100, wait_random_min=500, | ||
191 | + wait_random_max=4000, retry_on_exception=retry_if_request_failed) | ||
192 | + def request(self, *args, **kwargs): | ||
193 | + return super(StableTenderCreateClient, self).request(*args, **kwargs) | ||
194 | + | ||
195 | + | ||
196 | +def prepare_tender_create_wrapper(key, resource, host_url, api_version, ds_config=None): | ||
197 | + return StableTenderCreateClient(key, resource, host_url, api_version, | ||
198 | + ds_config=ds_config) |
@@ -10,6 +10,7 @@ ${VAT_INCLUDED} ${True} | @@ -10,6 +10,7 @@ ${VAT_INCLUDED} ${True} | ||
10 | ${NUMBER_OF_MILESTONES} ${1} | 10 | ${NUMBER_OF_MILESTONES} ${1} |
11 | ${ROAD_INDEX} ${False} | 11 | ${ROAD_INDEX} ${False} |
12 | ${GMDN_INDEX} ${False} | 12 | ${GMDN_INDEX} ${False} |
13 | +${PLAN_TENDER} ${True} | ||
13 | 14 | ||
14 | *** Test Cases *** | 15 | *** Test Cases *** |
15 | Можливість оголосити тендер | 16 | Можливість оголосити тендер |
@@ -19,6 +19,7 @@ ${lot_index} ${0} | @@ -19,6 +19,7 @@ ${lot_index} ${0} | ||
19 | ${award_index} ${0} | 19 | ${award_index} ${0} |
20 | ${ROAD_INDEX} ${False} | 20 | ${ROAD_INDEX} ${False} |
21 | ${GMDN_INDEX} ${False} | 21 | ${GMDN_INDEX} ${False} |
22 | +${PLAN_TENDER} ${True} | ||
22 | 23 | ||
23 | *** Test Cases *** | 24 | *** Test Cases *** |
24 | 25 |
@@ -115,9 +115,11 @@ def subtraction(value1, value2): | @@ -115,9 +115,11 @@ def subtraction(value1, value2): | ||
115 | def create_fake_value_amount(): | 115 | def create_fake_value_amount(): |
116 | return fake.random_int(min=1) | 116 | return fake.random_int(min=1) |
117 | 117 | ||
118 | + | ||
118 | def get_number_of_minutes(days, accelerator): | 119 | def get_number_of_minutes(days, accelerator): |
119 | return 1440 * int(days) / accelerator | 120 | return 1440 * int(days) / accelerator |
120 | 121 | ||
122 | + | ||
121 | def field_with_id(prefix, sentence): | 123 | def field_with_id(prefix, sentence): |
122 | return u"{}-{}: {}".format(prefix, fake.uuid4()[:8], sentence) | 124 | return u"{}-{}: {}".format(prefix, fake.uuid4()[:8], sentence) |
123 | 125 | ||
@@ -160,6 +162,7 @@ def create_fake_IsoDurationType( | @@ -160,6 +162,7 @@ def create_fake_IsoDurationType( | ||
160 | 162 | ||
161 | 163 | ||
162 | def test_tender_data(params, | 164 | def test_tender_data(params, |
165 | + plan_data, | ||
163 | periods=("enquiry", "tender"), | 166 | periods=("enquiry", "tender"), |
164 | submissionMethodDetails=None, | 167 | submissionMethodDetails=None, |
165 | funders=None, | 168 | funders=None, |
@@ -215,7 +218,11 @@ def test_tender_data(params, | @@ -215,7 +218,11 @@ def test_tender_data(params, | ||
215 | inc_dt += timedelta(minutes=params['intervals'][period_name][i]) | 218 | inc_dt += timedelta(minutes=params['intervals'][period_name][i]) |
216 | period_dict[period_name + "Period"][j + "Date"] = inc_dt.astimezone(TZ).isoformat() | 219 | period_dict[period_name + "Period"][j + "Date"] = inc_dt.astimezone(TZ).isoformat() |
217 | data.update(period_dict) | 220 | data.update(period_dict) |
218 | - if params.get('moz_integration'): | 221 | + if params.get('plan_tender'): |
222 | + data["procuringEntity"]["name"] = plan_data["data"]["procuringEntity"]["name"] | ||
223 | + data["procuringEntity"]["identifier"] = plan_data["data"]["procuringEntity"]["identifier"] | ||
224 | + cpv_group = plan_data["data"]["classification"]["id"] | ||
225 | + elif params.get('moz_integration'): | ||
219 | cpv_group = 336 | 226 | cpv_group = 336 |
220 | elif params.get('road_index'): | 227 | elif params.get('road_index'): |
221 | cpv_group = 'road' | 228 | cpv_group = 'road' |
@@ -295,10 +302,9 @@ def test_tender_data_planning(params): | @@ -295,10 +302,9 @@ def test_tender_data_planning(params): | ||
295 | "procuringEntity": { | 302 | "procuringEntity": { |
296 | "identifier": { | 303 | "identifier": { |
297 | "scheme": "UA-EDR", | 304 | "scheme": "UA-EDR", |
298 | - "id": str(fake.random_int(min=1, max=999)), | ||
299 | - "legalName": fake.description(), | 305 | + "id": random.choice(["13313462", "00037256"]), |
306 | + "legalName": random.choice([u"Київський Тестовий Ліцей", u"Київська Тестова міська клінічна лікарня"]), | ||
300 | }, | 307 | }, |
301 | - "name": fake.description(), | ||
302 | }, | 308 | }, |
303 | "tender": { | 309 | "tender": { |
304 | "procurementMethod": "", | 310 | "procurementMethod": "", |
@@ -307,10 +313,22 @@ def test_tender_data_planning(params): | @@ -307,10 +313,22 @@ def test_tender_data_planning(params): | ||
307 | "startDate": get_now().replace(hour=0, minute=0, second=0, microsecond=0).isoformat() | 313 | "startDate": get_now().replace(hour=0, minute=0, second=0, microsecond=0).isoformat() |
308 | } | 314 | } |
309 | }, | 315 | }, |
310 | - "items": [] | 316 | + "items": [], |
317 | + "buyers": [] | ||
311 | } | 318 | } |
312 | - id_cpv=fake.cpv()[:4] | ||
313 | - cpv_data=test_item_data(id_cpv) | 319 | + data["procuringEntity"]["name"] = data["procuringEntity"]["identifier"]["legalName"] |
320 | + buyers = test_buyers_data() | ||
321 | + buyers["name"] = buyers["identifier"]["legalName"] | ||
322 | + data['buyers'].append(buyers) | ||
323 | + if params.get('moz_integration'): | ||
324 | + id_cpv = 336 | ||
325 | + elif params.get('road_index'): | ||
326 | + id_cpv = fake.road_cpv()[:4] | ||
327 | + elif params.get('gmdn_index'): | ||
328 | + id_cpv = fake.gmdn_cpv()[:4] | ||
329 | + else: | ||
330 | + id_cpv = fake.cpv()[:4] | ||
331 | + cpv_data = test_item_data(id_cpv) | ||
314 | data.update(cpv_data) | 332 | data.update(cpv_data) |
315 | del data['deliveryDate'] | 333 | del data['deliveryDate'] |
316 | del data['description'] | 334 | del data['description'] |
@@ -321,7 +339,7 @@ def test_tender_data_planning(params): | @@ -321,7 +339,7 @@ def test_tender_data_planning(params): | ||
321 | del data['quantity'] | 339 | del data['quantity'] |
322 | del data['unit'] | 340 | del data['unit'] |
323 | for i in range(params['number_of_items']): | 341 | for i in range(params['number_of_items']): |
324 | - item_data=test_item_data(id_cpv) | 342 | + item_data = test_item_data(id_cpv) |
325 | del item_data['deliveryAddress'] | 343 | del item_data['deliveryAddress'] |
326 | del item_data['deliveryLocation'] | 344 | del item_data['deliveryLocation'] |
327 | item_data['deliveryDate']['endDate'] = (get_now() + timedelta(days=10)).replace(hour=0, minute=0, second=0, microsecond=0).isoformat() | 345 | item_data['deliveryDate']['endDate'] = (get_now() + timedelta(days=10)).replace(hour=0, minute=0, second=0, microsecond=0).isoformat() |
@@ -334,8 +352,8 @@ def test_tender_data_planning(params): | @@ -334,8 +352,8 @@ def test_tender_data_planning(params): | ||
334 | return munchify(data) | 352 | return munchify(data) |
335 | 353 | ||
336 | 354 | ||
337 | -def test_tender_data_limited(params): | ||
338 | - data = test_tender_data(params) | 355 | +def test_tender_data_limited(params, plan_data): |
356 | + data = test_tender_data(params, plan_data) | ||
339 | del data["submissionMethodDetails"] | 357 | del data["submissionMethodDetails"] |
340 | del data["minimalStep"] | 358 | del data["minimalStep"] |
341 | del data["enquiryPeriod"] | 359 | del data["enquiryPeriod"] |
@@ -639,31 +657,31 @@ def test_change_document_data(document, change_id): | @@ -639,31 +657,31 @@ def test_change_document_data(document, change_id): | ||
639 | return munchify(document) | 657 | return munchify(document) |
640 | 658 | ||
641 | 659 | ||
642 | -def test_tender_data_openua(params, submissionMethodDetails): | 660 | +def test_tender_data_openua(params, submissionMethodDetails, plan_data): |
643 | # We should not provide any values for `enquiryPeriod` when creating | 661 | # We should not provide any values for `enquiryPeriod` when creating |
644 | # an openUA or openEU procedure. That field should not be present at all. | 662 | # an openUA or openEU procedure. That field should not be present at all. |
645 | # Therefore, we pass a nondefault list of periods to `test_tender_data()`. | 663 | # Therefore, we pass a nondefault list of periods to `test_tender_data()`. |
646 | - data = test_tender_data(params, ('tender',), submissionMethodDetails) | 664 | + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails) |
647 | data['procurementMethodType'] = 'aboveThresholdUA' | 665 | data['procurementMethodType'] = 'aboveThresholdUA' |
648 | data['procuringEntity']['kind'] = 'general' | 666 | data['procuringEntity']['kind'] = 'general' |
649 | return data | 667 | return data |
650 | 668 | ||
651 | 669 | ||
652 | -def test_tender_data_openua_defense(params, submissionMethodDetails): | 670 | +def test_tender_data_openua_defense(params, submissionMethodDetails, plan_data): |
653 | """We should not provide any values for `enquiryPeriod` when creating | 671 | """We should not provide any values for `enquiryPeriod` when creating |
654 | an openUA, openEU or openUA_defense procedure. That field should not be present at all. | 672 | an openUA, openEU or openUA_defense procedure. That field should not be present at all. |
655 | Therefore, we pass a nondefault list of periods to `test_tender_data()`.""" | 673 | Therefore, we pass a nondefault list of periods to `test_tender_data()`.""" |
656 | - data = test_tender_data(params, ('tender',), submissionMethodDetails) | 674 | + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails) |
657 | data['procurementMethodType'] = 'aboveThresholdUA.defense' | 675 | data['procurementMethodType'] = 'aboveThresholdUA.defense' |
658 | data['procuringEntity']['kind'] = 'defense' | 676 | data['procuringEntity']['kind'] = 'defense' |
659 | return data | 677 | return data |
660 | 678 | ||
661 | 679 | ||
662 | -def test_tender_data_openeu(params, submissionMethodDetails): | 680 | +def test_tender_data_openeu(params, submissionMethodDetails, plan_data): |
663 | # We should not provide any values for `enquiryPeriod` when creating | 681 | # We should not provide any values for `enquiryPeriod` when creating |
664 | # an openUA or openEU procedure. That field should not be present at all. | 682 | # an openUA or openEU procedure. That field should not be present at all. |
665 | # Therefore, we pass a nondefault list of periods to `test_tender_data()`. | 683 | # Therefore, we pass a nondefault list of periods to `test_tender_data()`. |
666 | - data = test_tender_data(params, ('tender',), submissionMethodDetails) | 684 | + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails) |
667 | data['procurementMethodType'] = 'aboveThresholdEU' | 685 | data['procurementMethodType'] = 'aboveThresholdEU' |
668 | data['title_en'] = "[TESTING]" | 686 | data['title_en'] = "[TESTING]" |
669 | for item_number, item in enumerate(data['items']): | 687 | for item_number, item in enumerate(data['items']): |
@@ -676,8 +694,8 @@ def test_tender_data_openeu(params, submissionMethodDetails): | @@ -676,8 +694,8 @@ def test_tender_data_openeu(params, submissionMethodDetails): | ||
676 | return data | 694 | return data |
677 | 695 | ||
678 | 696 | ||
679 | -def test_tender_data_framework_agreement(params, submissionMethodDetails): | ||
680 | - data = test_tender_data_openeu(params, submissionMethodDetails) | 697 | +def test_tender_data_framework_agreement(params, submissionMethodDetails, plan_data): |
698 | + data = test_tender_data_openeu(params, submissionMethodDetails, plan_data) | ||
681 | data['procurementMethodType'] = 'closeFrameworkAgreementUA' | 699 | data['procurementMethodType'] = 'closeFrameworkAgreementUA' |
682 | data['maxAwardsCount'] = fake.random_int(min=3, max=5) | 700 | data['maxAwardsCount'] = fake.random_int(min=3, max=5) |
683 | data['agreementDuration'] = create_fake_IsoDurationType( | 701 | data['agreementDuration'] = create_fake_IsoDurationType( |
@@ -691,11 +709,11 @@ def test_tender_data_framework_agreement(params, submissionMethodDetails): | @@ -691,11 +709,11 @@ def test_tender_data_framework_agreement(params, submissionMethodDetails): | ||
691 | return data | 709 | return data |
692 | 710 | ||
693 | 711 | ||
694 | -def test_tender_data_competitive_dialogue(params, submissionMethodDetails): | 712 | +def test_tender_data_competitive_dialogue(params, submissionMethodDetails, plan_data): |
695 | # We should not provide any values for `enquiryPeriod` when creating | 713 | # We should not provide any values for `enquiryPeriod` when creating |
696 | # an openUA or openEU procedure. That field should not be present at all. | 714 | # an openUA or openEU procedure. That field should not be present at all. |
697 | # Therefore, we pass a nondefault list of periods to `test_tender_data()`. | 715 | # Therefore, we pass a nondefault list of periods to `test_tender_data()`. |
698 | - data = test_tender_data(params, ('tender',), submissionMethodDetails) | 716 | + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails) |
699 | if params.get('dialogue_type') == 'UA': | 717 | if params.get('dialogue_type') == 'UA': |
700 | data['procurementMethodType'] = 'competitiveDialogueUA' | 718 | data['procurementMethodType'] = 'competitiveDialogueUA' |
701 | else: | 719 | else: |
@@ -843,8 +861,8 @@ def test_elimination_report(corruption, relatedParty_id): | @@ -843,8 +861,8 @@ def test_elimination_report(corruption, relatedParty_id): | ||
843 | }) | 861 | }) |
844 | 862 | ||
845 | 863 | ||
846 | -def test_tender_data_esco(params, submissionMethodDetails): | ||
847 | - data = test_tender_data(params, ('tender',), submissionMethodDetails) | 864 | +def test_tender_data_esco(params, submissionMethodDetails, plan_data): |
865 | + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails) | ||
848 | data['procurementMethodType'] = 'esco' | 866 | data['procurementMethodType'] = 'esco' |
849 | data['title_en'] = "[TESTING]" | 867 | data['title_en'] = "[TESTING]" |
850 | for item_number, item in enumerate(data['items']): | 868 | for item_number, item in enumerate(data['items']): |
@@ -918,16 +936,37 @@ def invalid_INN_data(): | @@ -918,16 +936,37 @@ def invalid_INN_data(): | ||
918 | def invalid_cost_data(): | 936 | def invalid_cost_data(): |
919 | return munchify({ | 937 | return munchify({ |
920 | "scheme": "UA-ROAD", | 938 | "scheme": "UA-ROAD", |
921 | - "id": "М-15", | ||
922 | - "description": "Одеса - Рені (на м. Бухарест)" | 939 | + "id": "Н-08", |
940 | + "description": "Бориспіль - Дніпро - Запоріжжя (через м. Кременчук) - Маріуполь" | ||
923 | }) | 941 | }) |
924 | 942 | ||
925 | 943 | ||
926 | def invalid_gmdn_data(): | 944 | def invalid_gmdn_data(): |
927 | return munchify({ | 945 | return munchify({ |
928 | "scheme": "GMDN", | 946 | "scheme": "GMDN", |
929 | - "id": "33110", | ||
930 | - "description": "Коліматор радіонуклідної системи, високоенергетичний" | 947 | + "id": "10082", |
948 | + "description": "Змішувач амальгами для стоматології" | ||
931 | }) | 949 | }) |
932 | 950 | ||
933 | 951 | ||
952 | +def test_buyers_data(): | ||
953 | + buyers = { | ||
954 | + "identifier": { | ||
955 | + "scheme": "UA-EDR", | ||
956 | + "id": random.choice(["13313462", "00037256"]), | ||
957 | + "legalName": random.choice([u"Київський Тестовий Ліцей", u"Київська Тестова міська клінічна лікарня"]), | ||
958 | + } | ||
959 | + } | ||
960 | + return munchify(buyers) | ||
961 | + | ||
962 | + | ||
963 | +def invalid_buyers_data(): | ||
964 | + buyers = { | ||
965 | + "identifier": { | ||
966 | + "scheme": "UA-EDR", | ||
967 | + "id": "13313462", | ||
968 | + "legalName": "Київський Тестовий Ліцей", | ||
969 | + }, | ||
970 | + "name": "Київський Тестовий Ліцей" | ||
971 | + } | ||
972 | + return munchify(buyers) |
@@ -213,12 +213,12 @@ Get Broker Property By Username | @@ -213,12 +213,12 @@ Get Broker Property By Username | ||
213 | 213 | ||
214 | 214 | ||
215 | Підготувати дані для створення тендера | 215 | Підготувати дані для створення тендера |
216 | - [Arguments] ${tender_parameters} | 216 | + [Arguments] ${tender_parameters} ${plan_data} |
217 | ${period_intervals}= compute_intrs ${BROKERS} ${used_brokers} | 217 | ${period_intervals}= compute_intrs ${BROKERS} ${used_brokers} |
218 | ${submissionMethodDetails}= Get Variable Value ${submissionMethodDetails} | 218 | ${submissionMethodDetails}= Get Variable Value ${submissionMethodDetails} |
219 | ${accelerator}= Get Variable Value ${accelerator} | 219 | ${accelerator}= Get Variable Value ${accelerator} |
220 | ${funders}= Get Variable Value ${FUNDERS} | 220 | ${funders}= Get Variable Value ${FUNDERS} |
221 | - ${tender_data}= prepare_test_tender_data ${period_intervals} ${tender_parameters} ${submissionMethodDetails} ${accelerator} ${funders} | 221 | + ${tender_data}= prepare_test_tender_data ${period_intervals} ${tender_parameters} ${submissionMethodDetails} ${accelerator} ${funders} ${plan_data} |
222 | ${TENDER}= Create Dictionary | 222 | ${TENDER}= Create Dictionary |
223 | Set Global Variable ${TENDER} | 223 | Set Global Variable ${TENDER} |
224 | Log ${tender_data} | 224 | Log ${tender_data} |
@@ -19,6 +19,7 @@ ${MOZ_INTEGRATION} ${False} | @@ -19,6 +19,7 @@ ${MOZ_INTEGRATION} ${False} | ||
19 | ${VAT_INCLUDED} ${True} | 19 | ${VAT_INCLUDED} ${True} |
20 | ${ROAD_INDEX} ${False} | 20 | ${ROAD_INDEX} ${False} |
21 | ${GMDN_INDEX} ${False} | 21 | ${GMDN_INDEX} ${False} |
22 | +${PLAN_TENDER} ${True} | ||
22 | 23 | ||
23 | *** Test Cases *** | 24 | *** Test Cases *** |
24 | Можливість оголосити тендер | 25 | Можливість оголосити тендер |
@@ -18,6 +18,7 @@ ${MOZ_INTEGRATION} ${False} | @@ -18,6 +18,7 @@ ${MOZ_INTEGRATION} ${False} | ||
18 | ${VAT_INCLUDED} ${True} | 18 | ${VAT_INCLUDED} ${True} |
19 | ${ROAD_INDEX} ${False} | 19 | ${ROAD_INDEX} ${False} |
20 | ${GMDN_INDEX} ${False} | 20 | ${GMDN_INDEX} ${False} |
21 | +${PLAN_TENDER} ${True} | ||
21 | 22 | ||
22 | *** Test Cases *** | 23 | *** Test Cases *** |
23 | ############################################################################################## | 24 | ############################################################################################## |
@@ -18,6 +18,7 @@ ${MOZ_INTEGRATION} ${False} | @@ -18,6 +18,7 @@ ${MOZ_INTEGRATION} ${False} | ||
18 | ${VAT_INCLUDED} ${True} | 18 | ${VAT_INCLUDED} ${True} |
19 | ${ROAD_INDEX} ${False} | 19 | ${ROAD_INDEX} ${False} |
20 | ${GMDN_INDEX} ${False} | 20 | ${GMDN_INDEX} ${False} |
21 | +${PLAN_TENDER} ${True} | ||
21 | 22 | ||
22 | *** Test Cases *** | 23 | *** Test Cases *** |
23 | ############################################################################################## | 24 | ############################################################################################## |
@@ -167,6 +167,10 @@ class OP_Provider(BaseProvider): | @@ -167,6 +167,10 @@ class OP_Provider(BaseProvider): | ||
167 | for cpv_element in self.cpvs: | 167 | for cpv_element in self.cpvs: |
168 | if cpv_element.startswith(cpv_group): | 168 | if cpv_element.startswith(cpv_group): |
169 | similar_cpvs.append(cpv_element) | 169 | similar_cpvs.append(cpv_element) |
170 | + else: | ||
171 | + for cpv_element in self.moz_cpvs: | ||
172 | + if cpv_element.startswith(cpv_group): | ||
173 | + similar_cpvs.append(cpv_element) | ||
170 | cpv = self.random_element(similar_cpvs) | 174 | cpv = self.random_element(similar_cpvs) |
171 | for entity in self.items_base_data: | 175 | for entity in self.items_base_data: |
172 | if entity["cpv_id"] == cpv: | 176 | if entity["cpv_id"] == cpv: |
@@ -20,6 +20,7 @@ ${MOZ_INTEGRATION} ${False} | @@ -20,6 +20,7 @@ ${MOZ_INTEGRATION} ${False} | ||
20 | ${VAT_INCLUDED} ${True} | 20 | ${VAT_INCLUDED} ${True} |
21 | ${ROAD_INDEX} ${False} | 21 | ${ROAD_INDEX} ${False} |
22 | ${GMDN_INDEX} ${False} | 22 | ${GMDN_INDEX} ${False} |
23 | +${PLAN_TENDER} ${True} | ||
23 | 24 | ||
24 | *** Test Cases *** | 25 | *** Test Cases *** |
25 | Можливість оголосити тендер | 26 | Можливість оголосити тендер |
@@ -222,6 +223,46 @@ ${GMDN_INDEX} ${False} | @@ -222,6 +223,46 @@ ${GMDN_INDEX} ${False} | ||
222 | Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації класифікатор медичних виробів ${6} | 223 | Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації класифікатор медичних виробів ${6} |
223 | 224 | ||
224 | 225 | ||
226 | +Неможливість опублікувати тендер на закупівлю з невідповідним кодом ЄДРПОУ | ||
227 | + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення тендера | ||
228 | + ... tender_owner | ||
229 | + ... ${USERS.users['${tender_owner}'].broker} | ||
230 | + ... create_tender_invalid_edrpou level1 | ||
231 | + ... critical | ||
232 | + [Teardown] Оновити LAST_MODIFICATION_DATE | ||
233 | + Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації план-тендер ${1} | ||
234 | + | ||
235 | + | ||
236 | +Неможливість опублікувати тендер на закупівлю з невідповідною схемою | ||
237 | + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення тендера | ||
238 | + ... tender_owner | ||
239 | + ... ${USERS.users['${tender_owner}'].broker} | ||
240 | + ... create_tender_invalid_schema level1 | ||
241 | + ... critical | ||
242 | + [Teardown] Оновити LAST_MODIFICATION_DATE | ||
243 | + Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації план-тендер ${2} | ||
244 | + | ||
245 | + | ||
246 | +Неможливість опублікувати тендер на закупівлю з невідповідним cpv кодом | ||
247 | + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення тендера | ||
248 | + ... tender_owner | ||
249 | + ... ${USERS.users['${tender_owner}'].broker} | ||
250 | + ... create_tender_invalid_cpv level1 | ||
251 | + ... critical | ||
252 | + [Teardown] Оновити LAST_MODIFICATION_DATE | ||
253 | + Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації план-тендер ${3} | ||
254 | + | ||
255 | + | ||
256 | +Неможливість опублікувати тендер на закупівлю з невідповідним cpv кодом | ||
257 | + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення тендера | ||
258 | + ... tender_owner | ||
259 | + ... ${USERS.users['${tender_owner}'].broker} | ||
260 | + ... create_tender_invalid_procurementMethodType level1 | ||
261 | + ... critical | ||
262 | + [Teardown] Оновити LAST_MODIFICATION_DATE | ||
263 | + Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації план-тендер ${4} | ||
264 | + | ||
265 | + | ||
225 | Можливість знайти тендер по ідентифікатору | 266 | Можливість знайти тендер по ідентифікатору |
226 | [Tags] ${USERS.users['${viewer}'].broker}: Пошук тендера | 267 | [Tags] ${USERS.users['${viewer}'].broker}: Пошук тендера |
227 | ... viewer tender_owner provider provider1 | 268 | ... viewer tender_owner provider provider1 |
@@ -11,6 +11,9 @@ ${MODE} belowThreshold | @@ -11,6 +11,9 @@ ${MODE} belowThreshold | ||
11 | ${NUMBER_OF_ITEMS} ${2} | 11 | ${NUMBER_OF_ITEMS} ${2} |
12 | ${TENDER_MEAT} ${False} | 12 | ${TENDER_MEAT} ${False} |
13 | ${ITEM_MEAT} ${False} | 13 | ${ITEM_MEAT} ${False} |
14 | +${MOZ_INTEGRATION} ${False} | ||
15 | +${ROAD_INDEX} ${False} | ||
16 | +${GMDN_INDEX} ${False} | ||
14 | 17 | ||
15 | *** Test Cases *** | 18 | *** Test Cases *** |
16 | Можливість створити план закупівлі | 19 | Можливість створити план закупівлі |
@@ -23,6 +26,24 @@ ${ITEM_MEAT} ${False} | @@ -23,6 +26,24 @@ ${ITEM_MEAT} ${False} | ||
23 | Можливість створити план закупівлі | 26 | Можливість створити план закупівлі |
24 | 27 | ||
25 | 28 | ||
29 | +Можливість створити план закупівлі з двома buyers | ||
30 | + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення плану | ||
31 | + ... tender_owner | ||
32 | + ... ${USERS.users['${tender_owner}'].broker} | ||
33 | + ... create_plan_two_buyers | ||
34 | + ... critical | ||
35 | + Run Keyword And Expect Error * Можливість створити план закупівлі з використанням валідації для buyers ${1} | ||
36 | + | ||
37 | + | ||
38 | +Можливість створити план закупівлі з порожнім buyers | ||
39 | + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення плану | ||
40 | + ... tender_owner | ||
41 | + ... ${USERS.users['${tender_owner}'].broker} | ||
42 | + ... create_plan_no_buyers | ||
43 | + ... critical | ||
44 | + Run Keyword And Expect Error * Можливість створити план закупівлі з використанням валідації для buyers ${2} | ||
45 | + | ||
46 | + | ||
26 | Можливість знайти план по ідентифікатору | 47 | Можливість знайти план по ідентифікатору |
27 | [Tags] ${USERS.users['${viewer}'].broker}: Пошук плану | 48 | [Tags] ${USERS.users['${viewer}'].broker}: Пошук плану |
28 | ... viewer tender_owner | 49 | ... viewer tender_owner |
@@ -18,6 +18,7 @@ ${MOZ_INTEGRATION} ${False} | @@ -18,6 +18,7 @@ ${MOZ_INTEGRATION} ${False} | ||
18 | ${VAT_INCLUDED} ${True} | 18 | ${VAT_INCLUDED} ${True} |
19 | ${ROAD_INDEX} ${False} | 19 | ${ROAD_INDEX} ${False} |
20 | ${GMDN_INDEX} ${False} | 20 | ${GMDN_INDEX} ${False} |
21 | +${PLAN_TENDER} ${True} | ||
21 | 22 | ||
22 | *** Test Cases *** | 23 | *** Test Cases *** |
23 | ############################################################################################## | 24 | ############################################################################################## |
@@ -77,7 +77,8 @@ from .initial_data import ( | @@ -77,7 +77,8 @@ from .initial_data import ( | ||
77 | get_hash, | 77 | get_hash, |
78 | invalid_INN_data, | 78 | invalid_INN_data, |
79 | invalid_cost_data, | 79 | invalid_cost_data, |
80 | - invalid_gmdn_data | 80 | + invalid_gmdn_data, |
81 | + invalid_buyers_data | ||
81 | ) | 82 | ) |
82 | from barbecue import chef | 83 | from barbecue import chef |
83 | from restkit import request | 84 | from restkit import request |
@@ -320,7 +321,8 @@ def prepare_test_tender_data(procedure_intervals, | @@ -320,7 +321,8 @@ def prepare_test_tender_data(procedure_intervals, | ||
320 | tender_parameters, | 321 | tender_parameters, |
321 | submissionMethodDetails, | 322 | submissionMethodDetails, |
322 | accelerator, | 323 | accelerator, |
323 | - funders): | 324 | + funders, |
325 | + plan_data): | ||
324 | # Get actual intervals by mode name | 326 | # Get actual intervals by mode name |
325 | mode = tender_parameters['mode'] | 327 | mode = tender_parameters['mode'] |
326 | if mode in procedure_intervals: | 328 | if mode in procedure_intervals: |
@@ -337,35 +339,37 @@ def prepare_test_tender_data(procedure_intervals, | @@ -337,35 +339,37 @@ def prepare_test_tender_data(procedure_intervals, | ||
337 | assert intervals['accelerator'] >= 0, \ | 339 | assert intervals['accelerator'] >= 0, \ |
338 | "Accelerator should not be less than 0" | 340 | "Accelerator should not be less than 0" |
339 | if mode == 'negotiation': | 341 | if mode == 'negotiation': |
340 | - return munchify({'data': test_tender_data_limited(tender_parameters)}) | 342 | + return munchify({'data': test_tender_data_limited(tender_parameters, plan_data)}) |
341 | elif mode == 'negotiation.quick': | 343 | elif mode == 'negotiation.quick': |
342 | - return munchify({'data': test_tender_data_limited(tender_parameters)}) | 344 | + return munchify({'data': test_tender_data_limited(tender_parameters, plan_data)}) |
343 | elif mode == 'openeu': | 345 | elif mode == 'openeu': |
344 | return munchify({'data': test_tender_data_openeu( | 346 | return munchify({'data': test_tender_data_openeu( |
345 | - tender_parameters, submissionMethodDetails)}) | 347 | + tender_parameters, submissionMethodDetails, plan_data)}) |
346 | elif mode == 'openua': | 348 | elif mode == 'openua': |
347 | return munchify({'data': test_tender_data_openua( | 349 | return munchify({'data': test_tender_data_openua( |
348 | - tender_parameters, submissionMethodDetails)}) | 350 | + tender_parameters, submissionMethodDetails, plan_data)}) |
349 | elif mode == 'openua_defense': | 351 | elif mode == 'openua_defense': |
350 | return munchify({'data': test_tender_data_openua_defense( | 352 | return munchify({'data': test_tender_data_openua_defense( |
351 | - tender_parameters, submissionMethodDetails)}) | 353 | + tender_parameters, submissionMethodDetails, plan_data)}) |
352 | elif mode == 'open_competitive_dialogue': | 354 | elif mode == 'open_competitive_dialogue': |
353 | return munchify({'data': test_tender_data_competitive_dialogue( | 355 | return munchify({'data': test_tender_data_competitive_dialogue( |
354 | - tender_parameters, submissionMethodDetails)}) | 356 | + tender_parameters, submissionMethodDetails, plan_data)}) |
355 | elif mode == 'reporting': | 357 | elif mode == 'reporting': |
356 | - return munchify({'data': test_tender_data_limited(tender_parameters)}) | 358 | + return munchify({'data': test_tender_data_limited(tender_parameters, plan_data)}) |
357 | elif mode == 'open_framework': | 359 | elif mode == 'open_framework': |
358 | return munchify({'data': test_tender_data_framework_agreement( | 360 | return munchify({'data': test_tender_data_framework_agreement( |
359 | - tender_parameters, submissionMethodDetails)}) | 361 | + tender_parameters, submissionMethodDetails, plan_data)}) |
360 | elif mode == 'belowThreshold': | 362 | elif mode == 'belowThreshold': |
361 | return munchify({'data': test_tender_data( | 363 | return munchify({'data': test_tender_data( |
362 | tender_parameters, | 364 | tender_parameters, |
365 | + plan_data, | ||
363 | submissionMethodDetails=submissionMethodDetails, | 366 | submissionMethodDetails=submissionMethodDetails, |
364 | funders=funders, | 367 | funders=funders, |
365 | - accelerator=accelerator)}) | 368 | + accelerator=accelerator, |
369 | + )}) | ||
366 | elif mode == 'open_esco': | 370 | elif mode == 'open_esco': |
367 | return munchify({'data': test_tender_data_esco( | 371 | return munchify({'data': test_tender_data_esco( |
368 | - tender_parameters, submissionMethodDetails)}) | 372 | + tender_parameters, submissionMethodDetails, plan_data)}) |
369 | # The previous line needs an explicit keyword argument because, | 373 | # The previous line needs an explicit keyword argument because, |
370 | # unlike previous functions, this one has three arguments. | 374 | # unlike previous functions, this one has three arguments. |
371 | raise ValueError("Invalid mode for prepare_test_tender_data") | 375 | raise ValueError("Invalid mode for prepare_test_tender_data") |
@@ -678,23 +682,17 @@ def edit_tender_data_for_mnn(data, mode, data_version): | @@ -678,23 +682,17 @@ def edit_tender_data_for_mnn(data, mode, data_version): | ||
678 | id = {1: '33600000-6', 2: '33632100-0', 3: '33632100-0', 4: '33622200-8', 5: '33600000-6', 6: '33692500-2', 7: '33600000-6', 8: '33615100-5'} | 682 | id = {1: '33600000-6', 2: '33632100-0', 3: '33632100-0', 4: '33622200-8', 5: '33600000-6', 6: '33692500-2', 7: '33600000-6', 8: '33615100-5'} |
679 | dict_data = unmunchify(data) | 683 | dict_data = unmunchify(data) |
680 | dict_data['data']['items'][0]['classification']['id'] = id[data_version] | 684 | dict_data['data']['items'][0]['classification']['id'] = id[data_version] |
681 | - | ||
682 | if data_version is 3: | 685 | if data_version is 3: |
683 | dict_data['data']['items'][0].pop('additionalClassifications', None) | 686 | dict_data['data']['items'][0].pop('additionalClassifications', None) |
684 | - | ||
685 | if data_version is 4: | 687 | if data_version is 4: |
686 | add_INN = invalid_INN_data() | 688 | add_INN = invalid_INN_data() |
687 | dict_data['data']['items'][0]['additionalClassifications'].append(add_INN) | 689 | dict_data['data']['items'][0]['additionalClassifications'].append(add_INN) |
688 | - | ||
689 | if data_version is 5: | 690 | if data_version is 5: |
690 | dict_data['data']['items'][0].pop('additionalClassifications', None) | 691 | dict_data['data']['items'][0].pop('additionalClassifications', None) |
691 | - | ||
692 | if data_version is 6: | 692 | if data_version is 6: |
693 | dict_data['data']['items'][0]['additionalClassifications'].pop(0) | 693 | dict_data['data']['items'][0]['additionalClassifications'].pop(0) |
694 | - | ||
695 | if data_version is 7: | 694 | if data_version is 7: |
696 | dict_data['data']['items'][0]['additionalClassifications'].pop(1) | 695 | dict_data['data']['items'][0]['additionalClassifications'].pop(1) |
697 | - | ||
698 | if data_version is 8: | 696 | if data_version is 8: |
699 | dict_data['data']['items'][0]['additionalClassifications'].pop(1) | 697 | dict_data['data']['items'][0]['additionalClassifications'].pop(1) |
700 | return munchify(dict_data) | 698 | return munchify(dict_data) |
@@ -703,20 +701,15 @@ def edit_tender_data_for_mnn(data, mode, data_version): | @@ -703,20 +701,15 @@ def edit_tender_data_for_mnn(data, mode, data_version): | ||
703 | def edit_tender_data_for_cost(data, mode, data_version): | 701 | def edit_tender_data_for_cost(data, mode, data_version): |
704 | test_data = {3: 'PQ-17', 4: 'Дорога'} | 702 | test_data = {3: 'PQ-17', 4: 'Дорога'} |
705 | dict_data = unmunchify(data) | 703 | dict_data = unmunchify(data) |
706 | - | ||
707 | if data_version is 1: | 704 | if data_version is 1: |
708 | dict_data['data']['items'][0].pop('additionalClassifications', None) | 705 | dict_data['data']['items'][0].pop('additionalClassifications', None) |
709 | - | ||
710 | if data_version is 2: | 706 | if data_version is 2: |
711 | add_cost = invalid_cost_data() | 707 | add_cost = invalid_cost_data() |
712 | dict_data['data']['items'][0]['additionalClassifications'].append(add_cost) | 708 | dict_data['data']['items'][0]['additionalClassifications'].append(add_cost) |
713 | - | ||
714 | if data_version is 3: | 709 | if data_version is 3: |
715 | dict_data['data']['items'][0]['additionalClassifications'][0]['id'] = test_data[data_version] | 710 | dict_data['data']['items'][0]['additionalClassifications'][0]['id'] = test_data[data_version] |
716 | - | ||
717 | if data_version is 4: | 711 | if data_version is 4: |
718 | dict_data['data']['items'][0]['additionalClassifications'][0]['description'] = test_data[data_version] | 712 | dict_data['data']['items'][0]['additionalClassifications'][0]['description'] = test_data[data_version] |
719 | - | ||
720 | if data_version is 5: | 713 | if data_version is 5: |
721 | add_cost = invalid_cost_data() | 714 | add_cost = invalid_cost_data() |
722 | dict_data['data']['items'][0]['additionalClassifications'][0] = add_cost | 715 | dict_data['data']['items'][0]['additionalClassifications'][0] = add_cost |
@@ -726,27 +719,43 @@ def edit_tender_data_for_cost(data, mode, data_version): | @@ -726,27 +719,43 @@ def edit_tender_data_for_cost(data, mode, data_version): | ||
726 | def edit_tender_data_for_gmdn(data, mode, data_version): | 719 | def edit_tender_data_for_gmdn(data, mode, data_version): |
727 | gmdn_test_data = {3: '9999', 4: 'Виріб'} | 720 | gmdn_test_data = {3: '9999', 4: 'Виріб'} |
728 | dict_data = unmunchify(data) | 721 | dict_data = unmunchify(data) |
729 | - | ||
730 | if data_version is 1: | 722 | if data_version is 1: |
731 | dict_data['data']['items'][0].pop('additionalClassifications', None) | 723 | dict_data['data']['items'][0].pop('additionalClassifications', None) |
732 | - | ||
733 | if data_version is 2: | 724 | if data_version is 2: |
734 | add_gmdn = invalid_gmdn_data() | 725 | add_gmdn = invalid_gmdn_data() |
735 | dict_data['data']['items'][0]['additionalClassifications'].append(add_gmdn) | 726 | dict_data['data']['items'][0]['additionalClassifications'].append(add_gmdn) |
736 | - | ||
737 | if data_version is 3: | 727 | if data_version is 3: |
738 | dict_data['data']['items'][0]['additionalClassifications'][0]['id'] = gmdn_test_data[data_version] | 728 | dict_data['data']['items'][0]['additionalClassifications'][0]['id'] = gmdn_test_data[data_version] |
739 | - | ||
740 | if data_version is 4: | 729 | if data_version is 4: |
741 | dict_data['data']['items'][0]['additionalClassifications'][0]['description'] = gmdn_test_data[data_version] | 730 | dict_data['data']['items'][0]['additionalClassifications'][0]['description'] = gmdn_test_data[data_version] |
742 | - | ||
743 | if data_version is 5: | 731 | if data_version is 5: |
744 | add_gmdn = invalid_gmdn_data() | 732 | add_gmdn = invalid_gmdn_data() |
745 | dict_data['data']['items'][0]['additionalClassifications'][0] = add_gmdn | 733 | dict_data['data']['items'][0]['additionalClassifications'][0] = add_gmdn |
746 | - | ||
747 | if data_version is 6: | 734 | if data_version is 6: |
748 | add_INN = invalid_INN_data() | 735 | add_INN = invalid_INN_data() |
749 | dict_data['data']['items'][0]['additionalClassifications'].append(add_INN) | 736 | dict_data['data']['items'][0]['additionalClassifications'].append(add_INN) |
750 | return munchify(dict_data) | 737 | return munchify(dict_data) |
751 | 738 | ||
752 | 739 | ||
740 | +def edit_plan_buyers(data, data_version): | ||
741 | + dict_data = unmunchify(data) | ||
742 | + if data_version is 1: | ||
743 | + add_buyer = invalid_buyers_data() | ||
744 | + dict_data['data']['buyers'].append(add_buyer) | ||
745 | + if data_version is 2: | ||
746 | + dict_data['data'].pop('buyers') | ||
747 | + return munchify(dict_data) | ||
748 | + | ||
749 | + | ||
750 | +def edit_tender_data_for_plan_tender(data, mode, data_version): | ||
751 | + plan_tedner_test_data = {1: '03222111-4', 2: 'UA-FIN', 3: '11112222', 4: 'aboveThresholdEU'} | ||
752 | + dict_data = unmunchify(data) | ||
753 | + if data_version is 1: | ||
754 | + dict_data['data']['items'][0]['classification']['id'] = plan_tedner_test_data[data_version] | ||
755 | + if data_version is 2: | ||
756 | + dict_data['data']['procuringEntity']['identifier']['scheme'] = plan_tedner_test_data[data_version] | ||
757 | + if data_version is 3: | ||
758 | + dict_data['data']['procuringEntity']['identifier']['id'] = plan_tedner_test_data[data_version] | ||
759 | + if data_version is 4: | ||
760 | + dict_data['data']['procurementMethodType'] = plan_tedner_test_data[data_version] | ||
761 | + return munchify(dict_data) |
Please
register
or
login
to post a comment