Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Formatting log messages #104

Closed
manuGil opened this issue Mar 8, 2023 · 0 comments
Closed

Test: Formatting log messages #104

manuGil opened this issue Mar 8, 2023 · 0 comments
Assignees
Labels

Comments

@manuGil
Copy link
Collaborator

manuGil commented Mar 8, 2023

We need to implement tests for the following scenario:

Description

Test the formatting of log messages based on log level

Code Reference

class StreamFormatter(logging.Formatter):

Test Cases

Case: formatted is an instance of Formatter in the logging package

  • Preconditions: None
  • Test Steps:
    • create an instance of StreamFormatter
    • check if the object is an instance of logging.Formatter
  • Expected Result: instance test returns True

Test Cases

Case: change the formatting of log messages other than INFO level

  • Preconditions: Log record of type INFO
  • Test Steps:
    • create an instance of StreamFormatter
    • create formatted log string with format()
    • check if custom formatting is applied to log record when not of level INFO
  • Expected Result: returns string formatted according to the log level
  • Postcondition: formatted string of log record
@manuGil manuGil added the test label Mar 8, 2023
@manuGil manuGil self-assigned this Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant