mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-09-09 18:29:55 +00:00
This commit makes loggers like java.util.logging with fully qualified logger name which is created by LazyLogging trait
29 lines
743 B
Python
29 lines
743 B
Python
import pytest
|
|
|
|
from ahriman.core.alpm.repo import Repo
|
|
from ahriman.core.database import SQLite
|
|
|
|
|
|
def test_logger(database: SQLite) -> None:
|
|
"""
|
|
must set logger attribute
|
|
"""
|
|
assert database.logger
|
|
assert database.logger.name == "ahriman.core.database.sqlite.SQLite"
|
|
|
|
|
|
def test_logger_attribute_error(database: SQLite) -> None:
|
|
"""
|
|
must raise AttributeError in case if no attribute found
|
|
"""
|
|
with pytest.raises(AttributeError):
|
|
database.loggerrrr
|
|
|
|
|
|
def test_logger_name(database: SQLite, repo: Repo) -> None:
|
|
"""
|
|
must correctly generate logger name
|
|
"""
|
|
assert database.logger_name == "ahriman.core.database.sqlite.SQLite"
|
|
assert repo.logger_name == "ahriman.core.alpm.repo.Repo"
|