Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Feb 28, 2024
1 parent 23c9427 commit 3723b6c
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions robotframework_reportportal/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def to_epoch(date: Optional[str]) -> Optional[str]:
if hasattr(parsed_date, 'timestamp'):
epoch_time = parsed_date.timestamp()
else:
epoch_time = \
float(parsed_date.strftime('%s')) + parsed_date.microsecond / 1e6
epoch_time = float(parsed_date.strftime('%s')) + parsed_date.microsecond / 1e6
return str(int(epoch_time * 1000))


Expand Down Expand Up @@ -129,8 +128,7 @@ def start_launch(self, launch: Launch, mode: Optional[str] = None, rerun: bool =
'rerun_of': rerun_of,
'start_time': ts or to_epoch(launch.start_time) or timestamp()
}
logger.debug(
'ReportPortal - Start launch: request_body={0}'.format(sl_pt))
logger.debug('ReportPortal - Start launch: request_body={0}'.format(sl_pt))
return self.rp.start_launch(**sl_pt)

def finish_launch(self, launch: Launch, ts: Optional[str] = None) -> None:
Expand All @@ -143,8 +141,7 @@ def finish_launch(self, launch: Launch, ts: Optional[str] = None) -> None:
'end_time': ts or to_epoch(launch.end_time) or timestamp(),
'status': STATUS_MAPPING[launch.status]
}
logger.debug(
'ReportPortal - Finish launch: request_body={0}'.format(fl_rq))
logger.debug('ReportPortal - Finish launch: request_body={0}'.format(fl_rq))
self.rp.finish_launch(**fl_rq)

def start_suite(self, suite: Suite, ts: Optional[str] = None) -> Optional[str]:
Expand All @@ -162,8 +159,7 @@ def start_suite(self, suite: Suite, ts: Optional[str] = None) -> Optional[str]:
'parent_item_id': suite.rp_parent_item_id,
'start_time': ts or to_epoch(suite.start_time) or timestamp()
}
logger.debug(
'ReportPortal - Start suite: request_body={0}'.format(start_rq))
logger.debug('ReportPortal - Start suite: request_body={0}'.format(start_rq))
return self.rp.start_test_item(**start_rq)

def finish_suite(self, suite: Suite, issue: Optional[str] = None,
Expand All @@ -180,8 +176,7 @@ def finish_suite(self, suite: Suite, issue: Optional[str] = None,
'item_id': suite.rp_item_id,
'status': STATUS_MAPPING[suite.status]
}
logger.debug(
'ReportPortal - Finish suite: request_body={0}'.format(fta_rq))
logger.debug('ReportPortal - Finish suite: request_body={0}'.format(fta_rq))
self.rp.finish_test_item(**fta_rq)

def start_test(self, test: Test, ts: Optional[str] = None):
Expand All @@ -203,8 +198,7 @@ def start_test(self, test: Test, ts: Optional[str] = None):
'start_time': ts or to_epoch(test.start_time) or timestamp(),
'test_case_id': test.test_case_id
}
logger.debug(
'ReportPortal - Start test: request_body={0}'.format(start_rq))
logger.debug('ReportPortal - Start test: request_body={0}'.format(start_rq))
return self.rp.start_test_item(**start_rq)

def finish_test(self, test: Test, issue: Optional[str] = None, ts: Optional[str] = None):
Expand All @@ -221,8 +215,7 @@ def finish_test(self, test: Test, issue: Optional[str] = None, ts: Optional[str]
'item_id': test.rp_item_id,
'status': STATUS_MAPPING[test.status]
}
logger.debug(
'ReportPortal - Finish test: request_body={0}'.format(fta_rq))
logger.debug('ReportPortal - Finish test: request_body={0}'.format(fta_rq))
self.rp.finish_test_item(**fta_rq)

def start_keyword(self, keyword: Keyword, ts: Optional[str] = None):
Expand All @@ -239,8 +232,7 @@ def start_keyword(self, keyword: Keyword, ts: Optional[str] = None):
'parent_item_id': keyword.rp_parent_item_id,
'start_time': ts or to_epoch(keyword.start_time) or timestamp()
}
logger.debug(
'ReportPortal - Start keyword: request_body={0}'.format(start_rq))
logger.debug('ReportPortal - Start keyword: request_body={0}'.format(start_rq))
return self.rp.start_test_item(**start_rq)

def finish_keyword(self, keyword: Keyword, issue: Optional[str] = None, ts: Optional[str] = None):
Expand All @@ -256,8 +248,7 @@ def finish_keyword(self, keyword: Keyword, issue: Optional[str] = None, ts: Opti
'item_id': keyword.rp_item_id,
'status': STATUS_MAPPING[keyword.status]
}
logger.debug(
'ReportPortal - Finish keyword: request_body={0}'.format(fta_rq))
logger.debug('ReportPortal - Finish keyword: request_body={0}'.format(fta_rq))
self.rp.finish_test_item(**fta_rq)

def log(self, message: LogMessage, ts: Optional[str] = None):
Expand Down

0 comments on commit 3723b6c

Please sign in to comment.