mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-09-16 21:59:56 +00:00
gpg loader fix
This commit is contained in:
@ -17,7 +17,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
from ahriman.core import context
|
|
||||||
from ahriman.core.archive.archive_tree import ArchiveTree
|
from ahriman.core.archive.archive_tree import ArchiveTree
|
||||||
from ahriman.core.configuration import Configuration
|
from ahriman.core.configuration import Configuration
|
||||||
from ahriman.core.sign.gpg import GPG
|
from ahriman.core.sign.gpg import GPG
|
||||||
@ -45,9 +44,7 @@ class ArchiveTrigger(Trigger):
|
|||||||
Trigger.__init__(self, repository_id, configuration)
|
Trigger.__init__(self, repository_id, configuration)
|
||||||
|
|
||||||
self.paths = configuration.repository_paths
|
self.paths = configuration.repository_paths
|
||||||
|
self.tree = ArchiveTree(self.paths, GPG(configuration).repository_sign_args)
|
||||||
ctx = context.get()
|
|
||||||
self.tree = ArchiveTree(self.paths, ctx.get(GPG).repository_sign_args)
|
|
||||||
|
|
||||||
def on_result(self, result: Result, packages: list[Package]) -> None:
|
def on_result(self, result: Result, packages: list[Package]) -> None:
|
||||||
"""
|
"""
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from pytest_mock import MockerFixture
|
|
||||||
|
|
||||||
from ahriman.core.archive import ArchiveTrigger
|
from ahriman.core.archive import ArchiveTrigger
|
||||||
from ahriman.core.archive.archive_tree import ArchiveTree
|
from ahriman.core.archive.archive_tree import ArchiveTree
|
||||||
from ahriman.core.configuration import Configuration
|
from ahriman.core.configuration import Configuration
|
||||||
from ahriman.core.sign.gpg import GPG
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@ -23,18 +20,15 @@ def archive_tree(configuration: Configuration) -> ArchiveTree:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def archive_trigger(configuration: Configuration, gpg: GPG, mocker: MockerFixture) -> ArchiveTrigger:
|
def archive_trigger(configuration: Configuration) -> ArchiveTrigger:
|
||||||
"""
|
"""
|
||||||
archive trigger fixture
|
archive trigger fixture
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
configuration(Configuration): configuration fixture
|
configuration(Configuration): configuration fixture
|
||||||
gpg(GPG): GPG fixture
|
|
||||||
mocker(MockerFixture): mocker object
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
ArchiveTrigger: archive trigger test instance
|
ArchiveTrigger: archive trigger test instance
|
||||||
"""
|
"""
|
||||||
mocker.patch("ahriman.core._Context.get", return_value=GPG)
|
|
||||||
_, repository_id = configuration.check_loaded()
|
_, repository_id = configuration.check_loaded()
|
||||||
return ArchiveTrigger(repository_id, configuration)
|
return ArchiveTrigger(repository_id, configuration)
|
||||||
|
Reference in New Issue
Block a user