Commit 2dbb59c67ac9c0d247fd65e78bf57dd777418066

Authored by selurvedu
1 parent 523c59a8

Use new "intervals" format

... ... @@ -25,7 +25,7 @@ def create_fake_doc():
25 25 return tf.name
26 26
27 27
28   -def test_tender_data(period_interval):
  28 +def test_tender_data(intervals):
29 29 now = get_now()
30 30 return {
31 31 "title": u"[ТЕСТУВАННЯ] " + fake.catch_phrase(),
... ... @@ -109,18 +109,20 @@ def test_tender_data(period_interval):
109 109 ],
110 110 "enquiryPeriod": {
111 111 "startDate": (now).isoformat(),
112   - "endDate": (now + timedelta(minutes=1)).isoformat()
  112 + "endDate": (now + timedelta(minutes=(
  113 + intervals['enquiry']))).isoformat()
113 114 },
114 115 "tenderPeriod": {
115 116 "startDate": (now + timedelta(minutes=2)).isoformat(),
116   - "endDate": (now + timedelta(minutes=(2 + period_interval))).isoformat()
  117 + "endDate": (now + timedelta(minutes=(
  118 + intervals['tender']))).isoformat()
117 119 }
118 120 }
119 121
120 122
121   -def test_tender_data_multiple_lots(period_interval):
  123 +def test_tender_data_multiple_lots(intervals):
122 124 now = get_now()
123   - t_data = test_tender_data(period_interval)
  125 + t_data = test_tender_data(intervals)
124 126 t_data.update({
125 127 "items": [
126 128 {
... ...
... ... @@ -85,8 +85,8 @@ Get Broker Property By Username
85 85 ${reply}= test_complaint_reply_data
86 86 Append to list ${REPLIES} ${reply}
87 87 Set Global Variable @{REPLIES}
88   - ${period_interval}= Get Broker Property By Username ${tender_owner} period_interval
89   - ${INITIAL_TENDER_DATA}= prepare_test_tender_data ${period_interval} ${mode}
  88 + ${period_intervals}= Get Broker Property By Username ${tender_owner} intervals
  89 + ${INITIAL_TENDER_DATA}= prepare_test_tender_data ${period_intervals} ${mode}
90 90 Set Global Variable ${INITIAL_TENDER_DATA}
91 91 ${TENDER}= Create Dictionary
92 92 Set Global Variable ${TENDER}
... ...
... ... @@ -48,8 +48,8 @@ def change_state(arguments):
48 48 return "pass"
49 49
50 50
51   -def prepare_prom_test_tender_data(period_interval, mode):
52   - t_data = prepare_test_tender_data(period_interval, mode)
  51 +def prepare_prom_test_tender_data(period_intervals, mode):
  52 + t_data = prepare_test_tender_data(period_intervals, mode)
53 53 return munchify({'data': t_data})
54 54
55 55
... ... @@ -109,11 +109,11 @@ def load_initial_data_from(file_name):
109 109 return fromYAML(file_obj)
110 110
111 111
112   -def prepare_test_tender_data(period_interval, mode):
  112 +def prepare_test_tender_data(period_intervals, mode):
113 113 if mode == 'single':
114   - return munchify({'data': test_tender_data(period_interval=period_interval)})
  114 + return munchify({'data': test_tender_data(period_intervals)})
115 115 elif mode == 'multi':
116   - return munchify({'data': test_tender_data_multiple_lots(period_interval=period_interval)})
  116 + return munchify({'data': test_tender_data_multiple_lots(period_intervals)})
117 117 raise ValueError('Invalid mode for test_tender_data')
118 118
119 119
... ...
Please register or login to post a comment