Commit e7ab7e552f17ba6965afbd67b56d0cc95a82b3e8
Merge pull request #109 from mykhaly/update_mods
Remake tender creation and update modes
Showing
5 changed files
with
29 additions
and
25 deletions
@@ -194,26 +194,28 @@ def test_tender_data_multiple_items(intervals): | @@ -194,26 +194,28 @@ def test_tender_data_multiple_items(intervals): | ||
194 | return t_data | 194 | return t_data |
195 | 195 | ||
196 | 196 | ||
197 | -def test_tender_data_multiple_lots(t_data): | 197 | +def test_tender_data_multiple_lots(intervals): |
198 | + tender = test_tender_data_multiple_items(intervals) | ||
198 | first_lot_id = "3c8f387879de4c38957402dbdb8b31af" | 199 | first_lot_id = "3c8f387879de4c38957402dbdb8b31af" |
199 | second_lot_id = "bcac8d2ceb5f4227b841a2211f5cb646" | 200 | second_lot_id = "bcac8d2ceb5f4227b841a2211f5cb646" |
200 | 201 | ||
201 | - for item in t_data['data']['items'][:-1]: | 202 | + for item in tender['items'][:-1]: |
202 | item['relatedLot'] = first_lot_id | 203 | item['relatedLot'] = first_lot_id |
203 | - t_data['data']['items'][-1]['relatedLot'] = second_lot_id | ||
204 | - t_data['data']['lots'] = [] | 204 | + tender['items'][-1]['relatedLot'] = second_lot_id |
205 | + tender['lots'] = [] | ||
205 | for _ in range(2): | 206 | for _ in range(2): |
206 | new_lot = test_lot_data() | 207 | new_lot = test_lot_data() |
207 | - t_data['data']['lots'].append(new_lot) | ||
208 | - t_data['data']['lots'][0]['id'] = first_lot_id | ||
209 | - t_data['data']['lots'][1]['id'] = second_lot_id | ||
210 | - return t_data | 208 | + tender['lots'].append(new_lot) |
209 | + tender['lots'][0]['id'] = first_lot_id | ||
210 | + tender['lots'][1]['id'] = second_lot_id | ||
211 | + return tender | ||
211 | 212 | ||
212 | 213 | ||
213 | -def test_meat_tender_data(tender): | 214 | +def test_tender_data_meat(intervals): |
215 | + tender = munchify(test_tender_data(intervals)) | ||
214 | item_id = "edd0032574bf4402877ad5f362df225a" | 216 | item_id = "edd0032574bf4402877ad5f362df225a" |
215 | - tender.data['items'][0].id = item_id | ||
216 | - tender.data.features = [ | 217 | + tender['items'][0].id = item_id |
218 | + tender.features = [ | ||
217 | { | 219 | { |
218 | "code": "ee3e24bc17234a41bd3e3a04cc28e9c6", | 220 | "code": "ee3e24bc17234a41bd3e3a04cc28e9c6", |
219 | "featureOf": "tenderer", | 221 | "featureOf": "tenderer", |
@@ -10,7 +10,7 @@ Suite Setup Test Suite Setup | @@ -10,7 +10,7 @@ Suite Setup Test Suite Setup | ||
10 | Suite Teardown Test Suite Teardown | 10 | Suite Teardown Test Suite Teardown |
11 | 11 | ||
12 | *** Variables *** | 12 | *** Variables *** |
13 | -${mode} single | 13 | +${mode} meat |
14 | @{used_roles} tender_owner provider provider1 viewer | 14 | @{used_roles} tender_owner provider provider1 viewer |
15 | 15 | ||
16 | 16 | ||
@@ -22,8 +22,7 @@ ${mode} single | @@ -22,8 +22,7 @@ ${mode} single | ||
22 | ... minimal | 22 | ... minimal |
23 | [Documentation] Створення закупівлі замовником, обовязково має повертати UAID закупівлі (номер тендера), | 23 | [Documentation] Створення закупівлі замовником, обовязково має повертати UAID закупівлі (номер тендера), |
24 | [Teardown] Оновити LAST_MODIFICATION_DATE | 24 | [Teardown] Оновити LAST_MODIFICATION_DATE |
25 | - ${base_tender_data}= Підготовка даних для створення тендера | ||
26 | - ${tender_data}= test_meat_tender_data ${base_tender_data} | 25 | + ${tender_data}= Підготовка даних для створення тендера |
27 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_owner} ${tender_data} | 26 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_owner} ${tender_data} |
28 | ${TENDER_UAID}= Викликати для учасника ${tender_owner} Створити тендер ${adapted_data} | 27 | ${TENDER_UAID}= Викликати для учасника ${tender_owner} Створити тендер ${adapted_data} |
29 | Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data} | 28 | Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data} |
@@ -10,7 +10,7 @@ Suite Setup Test Suite Setup | @@ -10,7 +10,7 @@ Suite Setup Test Suite Setup | ||
10 | Suite Teardown Test Suite Teardown | 10 | Suite Teardown Test Suite Teardown |
11 | 11 | ||
12 | *** Variables *** | 12 | *** Variables *** |
13 | -${mode} multi | 13 | +${mode} multiItem |
14 | @{used_roles} tender_owner provider provider1 viewer | 14 | @{used_roles} tender_owner provider provider1 viewer |
15 | 15 | ||
16 | 16 |
@@ -10,7 +10,7 @@ Suite Setup Test Suite Setup | @@ -10,7 +10,7 @@ Suite Setup Test Suite Setup | ||
10 | Suite Teardown Test Suite Teardown | 10 | Suite Teardown Test Suite Teardown |
11 | 11 | ||
12 | *** Variables *** | 12 | *** Variables *** |
13 | -${mode} multi | 13 | +${mode} multiLot |
14 | @{used_roles} tender_owner provider provider1 viewer | 14 | @{used_roles} tender_owner provider provider1 viewer |
15 | ${complaint_id} 1 | 15 | ${complaint_id} 1 |
16 | 16 | ||
@@ -23,7 +23,6 @@ ${complaint_id} 1 | @@ -23,7 +23,6 @@ ${complaint_id} 1 | ||
23 | ... minimal | 23 | ... minimal |
24 | [Teardown] Оновити LAST_MODIFICATION_DATE | 24 | [Teardown] Оновити LAST_MODIFICATION_DATE |
25 | ${tender_data}= Підготовка даних для створення тендера | 25 | ${tender_data}= Підготовка даних для створення тендера |
26 | - ${tender_data}= test_tender_data_multiple_lots ${tender_data} | ||
27 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_owner} ${tender_data} | 26 | ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_owner} ${tender_data} |
28 | ${TENDER_UAID}= Викликати для учасника ${tender_owner} Створити тендер ${adapted_data} | 27 | ${TENDER_UAID}= Викликати для учасника ${tender_owner} Створити тендер ${adapted_data} |
29 | Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data} | 28 | Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data} |
@@ -41,13 +41,13 @@ from .initial_data import ( | @@ -41,13 +41,13 @@ from .initial_data import ( | ||
41 | test_lot_document_data, | 41 | test_lot_document_data, |
42 | test_lot_question_data, | 42 | test_lot_question_data, |
43 | test_lots_bid_data, | 43 | test_lots_bid_data, |
44 | - test_meat_tender_data, | ||
45 | test_question_answer_data, | 44 | test_question_answer_data, |
46 | test_question_data, | 45 | test_question_data, |
47 | test_submit_claim_data, | 46 | test_submit_claim_data, |
48 | test_supplier_data, | 47 | test_supplier_data, |
49 | test_tender_data, | 48 | test_tender_data, |
50 | test_tender_data_limited, | 49 | test_tender_data_limited, |
50 | + test_tender_data_meat, | ||
51 | test_tender_data_multiple_items, | 51 | test_tender_data_multiple_items, |
52 | test_tender_data_multiple_lots, | 52 | test_tender_data_multiple_lots, |
53 | test_tender_data_openeu, | 53 | test_tender_data_openeu, |
@@ -222,20 +222,24 @@ def prepare_test_tender_data(procedure_intervals, mode): | @@ -222,20 +222,24 @@ def prepare_test_tender_data(procedure_intervals, mode): | ||
222 | assert 'accelerator' not in intervals.keys(), \ | 222 | assert 'accelerator' not in intervals.keys(), \ |
223 | "Accelerator is not available for mode '{0}'".format(mode) | 223 | "Accelerator is not available for mode '{0}'".format(mode) |
224 | 224 | ||
225 | - if mode == 'single': | ||
226 | - return munchify({'data': test_tender_data(intervals)}) | ||
227 | - elif mode == 'multi': | 225 | + if mode == 'meat': |
226 | + return munchify({'data': test_tender_data_meat(intervals)}) | ||
227 | + elif mode == 'multiItem': | ||
228 | return munchify({'data': test_tender_data_multiple_items(intervals)}) | 228 | return munchify({'data': test_tender_data_multiple_items(intervals)}) |
229 | - elif mode == 'reporting': | ||
230 | - return munchify({'data': test_tender_data_limited(intervals, 'reporting')}) | 229 | + elif mode == 'multiLot': |
230 | + return munchify({'data': test_tender_data_multiple_lots(intervals)}) | ||
231 | elif mode == 'negotiation': | 231 | elif mode == 'negotiation': |
232 | return munchify({'data': test_tender_data_limited(intervals, 'negotiation')}) | 232 | return munchify({'data': test_tender_data_limited(intervals, 'negotiation')}) |
233 | elif mode == 'negotiation.quick': | 233 | elif mode == 'negotiation.quick': |
234 | return munchify({'data': test_tender_data_limited(intervals, 'negotiation.quick')}) | 234 | return munchify({'data': test_tender_data_limited(intervals, 'negotiation.quick')}) |
235 | - elif mode == 'openua': | ||
236 | - return munchify({'data': test_tender_data_openua(intervals)}) | ||
237 | elif mode == 'openeu': | 235 | elif mode == 'openeu': |
238 | return munchify({'data': test_tender_data_openeu(intervals)}) | 236 | return munchify({'data': test_tender_data_openeu(intervals)}) |
237 | + elif mode == 'openua': | ||
238 | + return munchify({'data': test_tender_data_openua(intervals)}) | ||
239 | + elif mode == 'reporting': | ||
240 | + return munchify({'data': test_tender_data_limited(intervals, 'reporting')}) | ||
241 | + elif mode == 'single': | ||
242 | + return munchify({'data': test_tender_data(intervals)}) | ||
239 | raise ValueError("Invalid mode for prepare_test_tender_data") | 243 | raise ValueError("Invalid mode for prepare_test_tender_data") |
240 | 244 | ||
241 | 245 |
Please
register
or
login
to post a comment