This repository has been archived on 2026-01-06. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
backup-tool/tests/test_logger.py
Jef Roosens 8929d743e9
Some checks failed
continuous-integration/drone the build failed
Added custom log function; started tests
2021-04-26 22:34:12 +02:00

23 lines
497 B
Python

"""Tests for the logger module."""
from app.logger import Logger
from datetime import datetime
def test_custom_stdout(capfd):
"""Test the custom command."""
logger = Logger()
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
logger.custom("a message", header="cewl")
out, _ = capfd.readouterr()
assert out == f"[{timestamp}][cewl] a message\n"
def test_log_stdout(capfd):
"""Test the log command with several levels."""
logger = Logger()
# TODO