mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-04-07 02:53:38 +00:00
remove duplicate code
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user