remove duplicate code

This commit is contained in:
2026-02-11 14:26:48 +02:00
parent 8c01c1c6bc
commit 49d433ab37
2 changed files with 2 additions and 13 deletions

View File

@@ -25,6 +25,7 @@ from sqlite3 import Connection
from ahriman.application.handlers.handler import Handler
from ahriman.core.alpm.pacman import Pacman
from ahriman.core.configuration import Configuration
from ahriman.core.utils import symlink_relative
from ahriman.models.package import Package
from ahriman.models.pacman_synchronization import PacmanSynchronization
from ahriman.models.repository_paths import RepositoryPaths
@@ -81,4 +82,4 @@ def move_packages(repository_paths: RepositoryPaths, pacman: Pacman) -> None:
source.rename(target)
# create symlink to the archive
source.symlink_to(target.relative_to(source.parent, walk_up=True))
symlink_relative(source, target)

View File

@@ -7,18 +7,6 @@ from ahriman.core.utils import utcnow
from ahriman.models.package import Package
def test_symlinks_create_empty_filename(archive_tree: ArchiveTree, package_ahriman: Package,
mocker: MockerFixture) -> None:
"""
must skip symlinks creation if filename is not set
"""
package_ahriman.packages[package_ahriman.base].filename = None
symlinks_mock = mocker.patch("pathlib.Path.symlink_to")
archive_tree.symlinks_create([package_ahriman])
symlinks_mock.assert_not_called()
def test_repo(archive_tree: ArchiveTree) -> None:
"""
must return correct repository object