constistent classmethod and staticmethod usage

General idea is to use classmethod for every constructor and
statismethod otherwise.
Also use self and cls whenever it's possible to call static and class
methods
This commit is contained in:
2021-03-31 04:15:55 +03:00
parent d449eb3c2e
commit 880c70bd58
18 changed files with 176 additions and 161 deletions

View File

@ -14,8 +14,8 @@ def test_from_path(mocker: MockerFixture) -> None:
load_logging_mock = mocker.patch("ahriman.core.configuration.Configuration.load_logging")
path = Path("path")
config = Configuration.from_path(path, "x86_64", True)
assert config.path == path
configuration = Configuration.from_path(path, "x86_64", True)
assert configuration.path == path
read_mock.assert_called_with(path)
load_includes_mock.assert_called_once()
load_logging_mock.assert_called_once()