aurweb/test/test_logging.py
Leonidas Spyropoulos 9c0f8f053e
chore: rename logging.py and redis.py to avoid circular imports
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-22 18:51:38 +01:00

16 lines
379 B
Python

from aurweb import aur_logging
logger = aur_logging.get_logger(__name__)
def test_logging(caplog):
logger.info("Test log.")
# Test that we logged once.
assert len(caplog.records) == 1
# Test that our log record was of INFO level.
assert caplog.records[0].levelname == "INFO"
# Test that our message got logged.
assert "Test log." in caplog.text