Commit fc11aa67f62d16b4fae462a2579d9ca6ff9f5209

Authored by selurvedu
1 parent 17f15b9e

Remove unused imports, improve PEP8 compliance

1 1 # -*- coding: utf-8 -
2   -from datetime import datetime, timedelta, date
  2 +from datetime import datetime, timedelta
3 3 from dateutil.parser import parse
4   -from dateutil.tz import tzlocal
5 4 from dpath.util import set as xpathset
6 5 from iso8601 import parse_date
7 6 from json import load
... ... @@ -12,6 +11,9 @@ from robot.errors import HandlerExecutionFailed
12 11 from robot.libraries.BuiltIn import BuiltIn
13 12 from robot.output import LOGGER
14 13 from robot.output.loggerhelper import Message
  14 +# These imports are not pointless. Robot's resource and testsuite files
  15 +# can access them by simply importing library "service_keywords".
  16 +# Please ignore the warning given by Flake8 or other linter.
15 17 from .initial_data import (
16 18 auction_bid, create_fake_doc,
17 19 test_award_data, test_bid_data, test_complaint_data,
... ... @@ -19,7 +21,6 @@ from .initial_data import (
19 21 test_question_data, test_tender_data, test_tender_data_multiple_lots
20 22 )
21 23 import os
22   -import time
23 24
24 25
25 26 TZ = timezone(os.environ['TZ'] if 'TZ' in os.environ else 'Europe/Kiev')
... ... @@ -134,7 +135,7 @@ def run_keyword_and_ignore_keyword_definitions(name, *args):
134 135 """
135 136 try:
136 137 status, _ = BuiltIn().run_keyword_and_ignore_error(name, *args)
137   - except HandlerExecutionFailed, e:
  138 + except HandlerExecutionFailed:
138 139 LOGGER.log_message(Message("Keyword {} not implemented", "ERROR"))
139 140 return "FAIL", ""
140 141 return status, _
... ... @@ -179,10 +180,10 @@ def wait_to_date(date_stamp):
179 180 return wait_seconds
180 181
181 182
182   -##GUI Frontends common
  183 +# GUI Frontends common
183 184 def add_data_for_gui_frontends(INITIAL_TENDER_DATA):
184 185 now = datetime.now()
185   - #INITIAL_TENDER_DATA.data.enquiryPeriod['startDate'] = (now + timedelta(minutes=2)).isoformat()
  186 + # INITIAL_TENDER_DATA.data.enquiryPeriod['startDate'] = (now + timedelta(minutes=2)).isoformat()
186 187 INITIAL_TENDER_DATA.data.enquiryPeriod['endDate'] = (now + timedelta(minutes=6)).isoformat()
187 188 INITIAL_TENDER_DATA.data.tenderPeriod['startDate'] = (now + timedelta(minutes=7)).isoformat()
188 189 INITIAL_TENDER_DATA.data.tenderPeriod['endDate'] = (now + timedelta(minutes=11)).isoformat()
... ...
Please register or login to post a comment