mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-09-17 14:19:55 +00:00
feat: add trigger loader guard
This commit is contained in:
@ -7,6 +7,13 @@ from ahriman.core.status import Client
|
||||
from ahriman.models.result import Result
|
||||
|
||||
|
||||
def test_requires_repository() -> None:
|
||||
"""
|
||||
must require repository identifier to be set to start
|
||||
"""
|
||||
assert LogsRotationTrigger.REQUIRES_REPOSITORY
|
||||
|
||||
|
||||
def test_configuration_sections(configuration: Configuration) -> None:
|
||||
"""
|
||||
must correctly parse target list
|
||||
|
@ -5,6 +5,13 @@ from ahriman.core.report import ReportTrigger
|
||||
from ahriman.models.result import Result
|
||||
|
||||
|
||||
def test_requires_repository() -> None:
|
||||
"""
|
||||
must require repository identifier to be set to start
|
||||
"""
|
||||
assert ReportTrigger.REQUIRES_REPOSITORY
|
||||
|
||||
|
||||
def test_configuration_sections(configuration: Configuration) -> None:
|
||||
"""
|
||||
must correctly parse target list
|
||||
|
@ -7,6 +7,13 @@ from ahriman.core.sign.gpg import GPG
|
||||
from ahriman.core.support import KeyringTrigger
|
||||
|
||||
|
||||
def test_requires_repository() -> None:
|
||||
"""
|
||||
must require repository identifier to be set to start
|
||||
"""
|
||||
assert KeyringTrigger.REQUIRES_REPOSITORY
|
||||
|
||||
|
||||
def test_configuration_sections(configuration: Configuration) -> None:
|
||||
"""
|
||||
must correctly parse target list
|
||||
|
@ -4,6 +4,13 @@ from ahriman.core.configuration import Configuration
|
||||
from ahriman.core.support import MirrorlistTrigger
|
||||
|
||||
|
||||
def test_requires_repository() -> None:
|
||||
"""
|
||||
must require repository identifier to be set to start
|
||||
"""
|
||||
assert MirrorlistTrigger.REQUIRES_REPOSITORY
|
||||
|
||||
|
||||
def test_configuration_sections(configuration: Configuration) -> None:
|
||||
"""
|
||||
must correctly parse target list
|
||||
|
@ -3,6 +3,7 @@ from unittest.mock import MagicMock
|
||||
from ahriman.core.configuration import Configuration
|
||||
from ahriman.core.report import ReportTrigger
|
||||
from ahriman.core.triggers import Trigger
|
||||
from ahriman.models.repository_id import RepositoryId
|
||||
from ahriman.models.result import Result
|
||||
|
||||
|
||||
@ -13,6 +14,19 @@ def test_architecture(trigger: Trigger) -> None:
|
||||
assert trigger.architecture == trigger.repository_id.architecture
|
||||
|
||||
|
||||
def test_is_allowed_to_run(trigger: Trigger) -> None:
|
||||
"""
|
||||
must return flag correctly
|
||||
"""
|
||||
assert trigger.is_allowed_to_run
|
||||
|
||||
trigger.repository_id = RepositoryId("", "")
|
||||
assert not trigger.is_allowed_to_run
|
||||
|
||||
trigger.REQUIRES_REPOSITORY = False
|
||||
assert trigger.is_allowed_to_run
|
||||
|
||||
|
||||
def test_configuration_schema(configuration: Configuration) -> None:
|
||||
"""
|
||||
must return used configuration schema
|
||||
|
@ -5,6 +5,13 @@ from ahriman.core.upload import UploadTrigger
|
||||
from ahriman.models.result import Result
|
||||
|
||||
|
||||
def test_requires_repository() -> None:
|
||||
"""
|
||||
must require repository identifier to be set to start
|
||||
"""
|
||||
assert UploadTrigger.REQUIRES_REPOSITORY
|
||||
|
||||
|
||||
def test_configuration_sections(configuration: Configuration) -> None:
|
||||
"""
|
||||
must correctly parse target list
|
||||
|
Reference in New Issue
Block a user