From 35019741acb82cef5646eba7ea63af244796002c Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Tue, 10 Feb 2026 02:13:35 +0200 Subject: [PATCH] fix rebase --- src/ahriman/core/archive/archive_tree.py | 2 +- src/ahriman/core/utils.py | 1 + tests/ahriman/core/archive/test_archive_tree.py | 2 +- tests/ahriman/models/test_repository_paths.py | 14 +------------- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/ahriman/core/archive/archive_tree.py b/src/ahriman/core/archive/archive_tree.py index 6c420fd3..09fd17c8 100644 --- a/src/ahriman/core/archive/archive_tree.py +++ b/src/ahriman/core/archive/archive_tree.py @@ -125,7 +125,7 @@ class ArchiveTree(LazyLogging): if root.exists(): return - with self.paths.preserve_owner(self.paths.archive): + with self.paths.preserve_owner(): root.mkdir(0o755, parents=True) # init empty repository here Repo(self.repository_id.name, self.paths, self.sign_args, root).init() diff --git a/src/ahriman/core/utils.py b/src/ahriman/core/utils.py index f55f7bdf..e9d53aa8 100644 --- a/src/ahriman/core/utils.py +++ b/src/ahriman/core/utils.py @@ -63,6 +63,7 @@ __all__ = [ "safe_filename", "srcinfo_property", "srcinfo_property_list", + "symlink_relative", "trim_package", "utcnow", "walk", diff --git a/tests/ahriman/core/archive/test_archive_tree.py b/tests/ahriman/core/archive/test_archive_tree.py index b6e80c40..28e4bbb3 100644 --- a/tests/ahriman/core/archive/test_archive_tree.py +++ b/tests/ahriman/core/archive/test_archive_tree.py @@ -117,7 +117,7 @@ def test_tree_create(archive_tree: ArchiveTree, mocker: MockerFixture) -> None: init_mock = mocker.patch("ahriman.core.alpm.repo.Repo.init") archive_tree.tree_create() - owner_guard_mock.assert_called_once_with(archive_tree.paths.archive) + owner_guard_mock.assert_called_once_with() mkdir_mock.assert_called_once_with(0o755, parents=True) init_mock.assert_called_once_with() diff --git a/tests/ahriman/models/test_repository_paths.py b/tests/ahriman/models/test_repository_paths.py index fa5512ae..31635729 100644 --- a/tests/ahriman/models/test_repository_paths.py +++ b/tests/ahriman/models/test_repository_paths.py @@ -203,7 +203,7 @@ def test_archive_for_create_tree(repository_paths: RepositoryPaths, package_ahri mkdir_mock = mocker.patch("pathlib.Path.mkdir") repository_paths.archive_for(package_ahriman.base) - owner_mock.assert_called_once_with(repository_paths.archive) + owner_mock.assert_called_once_with() mkdir_mock.assert_called_once_with(mode=0o755, parents=True) @@ -265,18 +265,6 @@ def test_preserve_owner_non_root(tmp_path: Path, repository_id: RepositoryId, mo setegid_mock.assert_not_called() -def test_preserve_owner_no_directory(tmp_path: Path, repository_id: RepositoryId, mocker: MockerFixture) -> None: - """ - must skip directory scan if it does not exist - """ - repository_paths = RepositoryPaths(tmp_path, repository_id) - chown_mock = mocker.patch("ahriman.models.repository_paths.RepositoryPaths._chown") - - with repository_paths.preserve_owner(Path("empty")): - (repository_paths.root / "created1").touch() - chown_mock.assert_not_called() - - def test_tree_clear(repository_paths: RepositoryPaths, package_ahriman: Package, mocker: MockerFixture) -> None: """ must remove any package related files