Commit 9e91909760297c839f967163c4769fdcea2ae0f0
1 parent
52794042
added dates generator for prom test, state changer for keywords
Showing
1 changed file
with
28 additions
and
2 deletions
... | ... | @@ -7,7 +7,7 @@ from robot.output import LOGGER |
7 | 7 | from robot.output.loggerhelper import Message |
8 | 8 | from robot.libraries.BuiltIn import BuiltIn |
9 | 9 | from robot.errors import HandlerExecutionFailed |
10 | -from datetime import datetime, timedelta | |
10 | +from datetime import datetime, timedelta, date | |
11 | 11 | from dateutil.parser import parse |
12 | 12 | from dateutil.tz import tzlocal |
13 | 13 | from dpath.util import set as xpathset |
... | ... | @@ -16,8 +16,34 @@ import time |
16 | 16 | from .initial_data import ( |
17 | 17 | test_tender_data, test_question_data, test_question_answer_data, |
18 | 18 | test_bid_data, test_award_data, test_complaint_data, test_complaint_reply_data, test_tender_data_multiple_lots, |
19 | - auction_bid | |
19 | + auction_bid, prom_tender_data | |
20 | 20 | ) |
21 | + | |
22 | +def change_state(arguments): | |
23 | + try: | |
24 | + if arguments[0] == "shouldfail": | |
25 | + return "shouldfail" | |
26 | + return "pass" | |
27 | + except IndexError: | |
28 | + return "pass" | |
29 | + | |
30 | +def prepare_prom_tender_data(): | |
31 | + return munchify({'data': prom_tender_data()}) | |
32 | + | |
33 | +def get_dates(): | |
34 | + start_date = date.today() | |
35 | + end_date = start_date + timedelta(days=1) | |
36 | + start_request_date = start_date + timedelta(days=2) | |
37 | + end_request_date = start_date + timedelta(days=3) | |
38 | + date_delivery_start = start_date + timedelta(days=4) | |
39 | + date_delivery_end = start_date + timedelta(days=5) | |
40 | + return { | |
41 | + 'end_date': end_date.strftime("%d.%m.%Y %H:%M"), | |
42 | + 'start_request_date': start_request_date.strftime("%d.%m.%Y %H:%M"), | |
43 | + 'end_request_date': end_request_date.strftime("%d.%m.%Y %H:%M"), | |
44 | + 'date_delivery_start': date_delivery_start.strftime("%d.%m.%Y %H:%M"), | |
45 | + 'date_delivery_end': date_delivery_end.strftime("%d.%m.%Y %H:%M"), | |
46 | + } | |
21 | 47 | def compare_date (isodate, broker_date): |
22 | 48 | iso_dt=parse_date(isodate) |
23 | 49 | br_dt=datetime.strptime(broker_date, "%d-%m-%Y, %H:%M") | ... | ... |
Please
register
or
login
to post a comment