mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-09-18 22:59:55 +00:00
fix tests and update docs
This commit is contained in:
@ -79,6 +79,7 @@ def test_schema(configuration: Configuration) -> None:
|
||||
assert schema.pop("s3")
|
||||
assert schema.pop("telegram")
|
||||
assert schema.pop("upload")
|
||||
assert schema.pop("worker")
|
||||
|
||||
assert schema == CONFIGURATION_SCHEMA
|
||||
|
||||
|
@ -80,6 +80,7 @@ def test_register(distributed_system: DistributedSystem, mocker: MockerFixture)
|
||||
"""
|
||||
must register service
|
||||
"""
|
||||
mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.load_identifier", return_value="id")
|
||||
mocker.patch("pathlib.Path.is_file", return_value=False)
|
||||
run_mock = mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.make_request")
|
||||
write_mock = mocker.patch("pathlib.Path.write_text")
|
||||
@ -95,6 +96,7 @@ def test_register_skip(distributed_system: DistributedSystem, mocker: MockerFixt
|
||||
"""
|
||||
must skip service registration if it doesn't owe the identifier
|
||||
"""
|
||||
mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.load_identifier", return_value="id")
|
||||
mocker.patch("pathlib.Path.is_file", return_value=True)
|
||||
run_mock = mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.make_request")
|
||||
write_mock = mocker.patch("pathlib.Path.write_text")
|
||||
@ -109,6 +111,7 @@ def test_register_force(distributed_system: DistributedSystem, mocker: MockerFix
|
||||
"""
|
||||
must register service even if it doesn't owe the identifier if force is supplied
|
||||
"""
|
||||
mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.load_identifier", return_value="id")
|
||||
mocker.patch("pathlib.Path.is_file", return_value=True)
|
||||
run_mock = mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.make_request")
|
||||
write_mock = mocker.patch("pathlib.Path.write_text")
|
||||
@ -124,6 +127,7 @@ def test_unregister(distributed_system: DistributedSystem, mocker: MockerFixture
|
||||
"""
|
||||
must unregister service
|
||||
"""
|
||||
mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.load_identifier", return_value="id")
|
||||
run_mock = mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.make_request")
|
||||
remove_mock = mocker.patch("pathlib.Path.unlink")
|
||||
distributed_system._owe_identifier = True
|
||||
@ -138,6 +142,7 @@ def test_unregister_skip(distributed_system: DistributedSystem, mocker: MockerFi
|
||||
"""
|
||||
must skip service removal if it doesn't owe the identifier
|
||||
"""
|
||||
mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.load_identifier", return_value="id")
|
||||
run_mock = mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.make_request")
|
||||
remove_mock = mocker.patch("pathlib.Path.unlink")
|
||||
|
||||
@ -150,6 +155,7 @@ def test_unregister_force(distributed_system: DistributedSystem, mocker: MockerF
|
||||
"""
|
||||
must remove service even if it doesn't owe the identifier if force is supplied
|
||||
"""
|
||||
mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.load_identifier", return_value="id")
|
||||
run_mock = mocker.patch("ahriman.core.distributed.distributed_system.DistributedSystem.make_request")
|
||||
remove_mock = mocker.patch("pathlib.Path.unlink")
|
||||
|
||||
|
@ -25,7 +25,7 @@ ignore_packages =
|
||||
makechrootpkg_flags =
|
||||
makepkg_flags = --skippgpcheck
|
||||
triggers = ahriman.core.report.ReportTrigger ahriman.core.upload.UploadTrigger
|
||||
triggers_known = ahriman.core.gitremote.RemotePullTrigger ahriman.core.gitremote.RemotePushTrigger ahriman.core.report.ReportTrigger ahriman.core.upload.UploadTrigger ahriman.core.support.KeyringTrigger ahriman.core.support.MirrorlistTrigger
|
||||
triggers_known = ahriman.core.distributed.WorkerLoaderTrigger ahriman.core.distributed.WorkerRegisterTrigger ahriman.core.distributed.WorkerTrigger ahriman.core.distributed.WorkerUnregisterTrigger ahriman.core.gitremote.RemotePullTrigger ahriman.core.gitremote.RemotePushTrigger ahriman.core.report.ReportTrigger ahriman.core.upload.UploadTrigger ahriman.core.support.KeyringTrigger ahriman.core.support.MirrorlistTrigger
|
||||
|
||||
[repository]
|
||||
name = aur-clone
|
||||
|
Reference in New Issue
Block a user