Log

class tir.technologies.core.log.Log(suite_datetime='', user='', station='', program='', program_date='01/01/1980 12:00:00', version='', release='', database='', issue='', execution_id='', country='', folder='', test_type='TIR')

This class is instantiated to create the log file and to append the results and failures to it.

Usage:

>>> # Instanted inside base.py:
>>> self.log = Log()
generate_header()

Generates the header line on the log file.

Usage:

>>> # Calling the method:
>>> self.log.generate_header()
get_testcase_stack()

Returns a string with the current testcase name [Internal]

list_of_testcases()

Returns a list of test cases from suite

new_line(result, message)

Appends a new line with data on log file.

Parameters
  • result (bool) – The result of the case.

  • message (str) – The message to be logged..

Usage:

>>> # Calling the method:
>>> self.log.new_line(True, "Success")
save_file(filename)

Writes the log file to the file system.

Usage:

>>> # Calling the method:
>>> self.log.save_file()
set_seconds()

Sets the seconds variable through a calculation of current time minus the execution start time.

Usage:

>>> # Calling the method:
>>> self.log.set_seconds()