SCAutolib.models.log

Functions

assert_log(path, expected_log)[source]

Asserts, that a new line in log is created, that matches given regex.

Parameters:
  • path (str) – Path to the file, that will be checked for added logs.

  • expected_log (str) – Regular expression that has to match one of the new logs.

When the context manager starts, the log file is skipped until the end to ignore any previous logs. Then the action inside the context manager is run. This action should generate some logs. When the context manager exits, newly generated logs are matched to the regular expression. In case none of the logs match, an exception is raised.