aki_prj23_transparenzregister/tests/utils/logger_config_test.py
Philipp Horstenkamp 820fb3e52b
Repaired the SQL copy and reduced the log volume a bit (#141)
- Added a cli interface to the SQL copy
- Repaired the SQL copy function
- Added the SQL copy function to the scripts
- Reduced the logging verbosity
2023-09-24 15:11:49 +02:00

27 lines
764 B
Python

"""Smoke-test over the logger config."""
from pathlib import Path
import pytest
from aki_prj23_transparenzregister.utils.logger_config import configer_logger
@pytest.mark.parametrize("path", [None, "test-log.log", ""])
@pytest.mark.parametrize("upper", [True, False])
@pytest.mark.parametrize("level", ["info", "debug", "error", "warning"])
def test_configer_logger(
level: str,
upper: bool,
path: Path | str | None,
) -> None:
"""Tests the configuration of the logger.
Args:
level: The log-level to configure.
upper: If the upper variant of the level should be used.
path: The path where to save the log.
"""
if level.upper():
level = level.upper()
configer_logger(level, path) # type: ignore