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:
arcanis committed 2021-03-31 04:29:08 +03:00
1 parent d449eb3c2e
commit 880c70bd58
18 files changed
+176 -161

No files matched your search

+2 -2
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()