Commit e7ab7e552f17ba6965afbd67b56d0cc95a82b3e8

Authored by selurvedu
2 parents caae4495 d3285968

Merge pull request #109 from mykhaly/update_mods

Remake tender creation and update modes
... ... @@ -194,26 +194,28 @@ def test_tender_data_multiple_items(intervals):
194 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 199 first_lot_id = "3c8f387879de4c38957402dbdb8b31af"
199 200 second_lot_id = "bcac8d2ceb5f4227b841a2211f5cb646"
200 201
201   - for item in t_data['data']['items'][:-1]:
  202 + for item in tender['items'][:-1]:
202 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 206 for _ in range(2):
206 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 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 220 "code": "ee3e24bc17234a41bd3e3a04cc28e9c6",
219 221 "featureOf": "tenderer",
... ...
... ... @@ -10,7 +10,7 @@ Suite Setup Test Suite Setup
10 10 Suite Teardown Test Suite Teardown
11 11
12 12 *** Variables ***
13   -${mode} single
  13 +${mode} meat
14 14 @{used_roles} tender_owner provider provider1 viewer
15 15
16 16
... ... @@ -22,8 +22,7 @@ ${mode} single
22 22 ... minimal
23 23 [Documentation] Створення закупівлі замовником, обовязково має повертати UAID закупівлі (номер тендера),
24 24 [Teardown] Оновити LAST_MODIFICATION_DATE
25   - ${base_tender_data}= Підготовка даних для створення тендера
26   - ${tender_data}= test_meat_tender_data ${base_tender_data}
  25 + ${tender_data}= Підготовка даних для створення тендера
27 26 ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_owner} ${tender_data}
28 27 ${TENDER_UAID}= Викликати для учасника ${tender_owner} Створити тендер ${adapted_data}
29 28 Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data}
... ...
... ... @@ -10,7 +10,7 @@ Suite Setup Test Suite Setup
10 10 Suite Teardown Test Suite Teardown
11 11
12 12 *** Variables ***
13   -${mode} multi
  13 +${mode} multiItem
14 14 @{used_roles} tender_owner provider provider1 viewer
15 15
16 16
... ...
... ... @@ -10,7 +10,7 @@ Suite Setup Test Suite Setup
10 10 Suite Teardown Test Suite Teardown
11 11
12 12 *** Variables ***
13   -${mode} multi
  13 +${mode} multiLot
14 14 @{used_roles} tender_owner provider provider1 viewer
15 15 ${complaint_id} 1
16 16
... ... @@ -23,7 +23,6 @@ ${complaint_id} 1
23 23 ... minimal
24 24 [Teardown] Оновити LAST_MODIFICATION_DATE
25 25 ${tender_data}= Підготовка даних для створення тендера
26   - ${tender_data}= test_tender_data_multiple_lots ${tender_data}
27 26 ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_owner} ${tender_data}
28 27 ${TENDER_UAID}= Викликати для учасника ${tender_owner} Створити тендер ${adapted_data}
29 28 Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data}
... ...
... ... @@ -41,13 +41,13 @@ from .initial_data import (
41 41 test_lot_document_data,
42 42 test_lot_question_data,
43 43 test_lots_bid_data,
44   - test_meat_tender_data,
45 44 test_question_answer_data,
46 45 test_question_data,
47 46 test_submit_claim_data,
48 47 test_supplier_data,
49 48 test_tender_data,
50 49 test_tender_data_limited,
  50 + test_tender_data_meat,
51 51 test_tender_data_multiple_items,
52 52 test_tender_data_multiple_lots,
53 53 test_tender_data_openeu,
... ... @@ -222,20 +222,24 @@ def prepare_test_tender_data(procedure_intervals, mode):
222 222 assert 'accelerator' not in intervals.keys(), \
223 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 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 231 elif mode == 'negotiation':
232 232 return munchify({'data': test_tender_data_limited(intervals, 'negotiation')})
233 233 elif mode == 'negotiation.quick':
234 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 235 elif mode == 'openeu':
238 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 243 raise ValueError("Invalid mode for prepare_test_tender_data")
240 244
241 245
... ...
Please register or login to post a comment