Commit 30dba375650cf6b38fd56e62500ec6b9be793e5a
1 parent
38283847
Handle updated brokers.yaml format
Showing
1 changed file
with
11 additions
and
12 deletions
@@ -20,7 +20,7 @@ def create_fake_doc(): | @@ -20,7 +20,7 @@ def create_fake_doc(): | ||
20 | 20 | ||
21 | def test_tender_data(intervals): | 21 | def test_tender_data(intervals): |
22 | now = get_now() | 22 | now = get_now() |
23 | - return { | 23 | + t_data = { |
24 | "title": u"[ТЕСТУВАННЯ] " + fake.catch_phrase(), | 24 | "title": u"[ТЕСТУВАННЯ] " + fake.catch_phrase(), |
25 | "mode": "test", | 25 | "mode": "test", |
26 | "submissionMethodDetails": "quick", | 26 | "submissionMethodDetails": "quick", |
@@ -99,18 +99,17 @@ def test_tender_data(intervals): | @@ -99,18 +99,17 @@ def test_tender_data(intervals): | ||
99 | }, | 99 | }, |
100 | "quantity": fake.pyint() | 100 | "quantity": fake.pyint() |
101 | } | 101 | } |
102 | - ], | ||
103 | - "enquiryPeriod": { | ||
104 | - "startDate": (now).isoformat(), | ||
105 | - "endDate": (now + timedelta(minutes=( | ||
106 | - intervals['enquiry']))).isoformat() | ||
107 | - }, | ||
108 | - "tenderPeriod": { | ||
109 | - "startDate": (now + timedelta(minutes=2)).isoformat(), | ||
110 | - "endDate": (now + timedelta(minutes=( | ||
111 | - intervals['tender']))).isoformat() | ||
112 | - } | 102 | + ] |
113 | } | 103 | } |
104 | + period_dict = {} | ||
105 | + inc_dt = now | ||
106 | + for period_name in ("enquiry", "tender"): | ||
107 | + period_dict[period_name + "Period"] = {} | ||
108 | + for i, j in zip(range(2), ("start", "end")): | ||
109 | + inc_dt += timedelta(minutes=intervals[period_name][i]) | ||
110 | + period_dict[period_name + "Period"][j + "Date"] = inc_dt.isoformat() | ||
111 | + t_data.update(period_dict) | ||
112 | + return t_data | ||
114 | 113 | ||
115 | 114 | ||
116 | def test_tender_data_multiple_lots(intervals): | 115 | def test_tender_data_multiple_lots(intervals): |
Please
register
or
login
to post a comment