mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-04-07 11:03:37 +00:00
fix naming
This commit is contained in:
@@ -50,7 +50,7 @@ class TreeMigrate(Handler):
|
|||||||
target_tree.tree_create()
|
target_tree.tree_create()
|
||||||
# perform migration
|
# perform migration
|
||||||
TreeMigrate.tree_move(current_tree, target_tree)
|
TreeMigrate.tree_move(current_tree, target_tree)
|
||||||
TreeMigrate.fix_symlinks(target_tree)
|
TreeMigrate.symlinks_fix(target_tree)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _set_service_tree_migrate_parser(root: SubParserAction) -> argparse.ArgumentParser:
|
def _set_service_tree_migrate_parser(root: SubParserAction) -> argparse.ArgumentParser:
|
||||||
@@ -69,7 +69,7 @@ class TreeMigrate(Handler):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def fix_symlinks(paths: RepositoryPaths) -> None:
|
def symlinks_fix(paths: RepositoryPaths) -> None:
|
||||||
"""
|
"""
|
||||||
fix package archive symlinks
|
fix package archive symlinks
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ def test_run(args: argparse.Namespace, configuration: Configuration, mocker: Moc
|
|||||||
"""
|
"""
|
||||||
tree_create_mock = mocker.patch("ahriman.models.repository_paths.RepositoryPaths.tree_create")
|
tree_create_mock = mocker.patch("ahriman.models.repository_paths.RepositoryPaths.tree_create")
|
||||||
application_mock = mocker.patch("ahriman.application.handlers.tree_migrate.TreeMigrate.tree_move")
|
application_mock = mocker.patch("ahriman.application.handlers.tree_migrate.TreeMigrate.tree_move")
|
||||||
symlinks_mock = mocker.patch("ahriman.application.handlers.tree_migrate.TreeMigrate.fix_symlinks")
|
symlinks_mock = mocker.patch("ahriman.application.handlers.tree_migrate.TreeMigrate.symlinks_fix")
|
||||||
_, repository_id = configuration.check_loaded()
|
_, repository_id = configuration.check_loaded()
|
||||||
old_paths = configuration.repository_paths
|
old_paths = configuration.repository_paths
|
||||||
new_paths = RepositoryPaths(old_paths.root, old_paths.repository_id, _force_current_tree=True)
|
new_paths = RepositoryPaths(old_paths.root, old_paths.repository_id, _force_current_tree=True)
|
||||||
@@ -28,7 +28,7 @@ def test_run(args: argparse.Namespace, configuration: Configuration, mocker: Moc
|
|||||||
symlinks_mock.assert_called_once_with(new_paths)
|
symlinks_mock.assert_called_once_with(new_paths)
|
||||||
|
|
||||||
|
|
||||||
def test_fix_symlinks(repository_paths: RepositoryPaths, package_ahriman: Package, mocker: MockerFixture) -> None:
|
def test_symlinks_fix(repository_paths: RepositoryPaths, package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||||
"""
|
"""
|
||||||
must replace symlinks during migration
|
must replace symlinks during migration
|
||||||
"""
|
"""
|
||||||
@@ -46,7 +46,7 @@ def test_fix_symlinks(repository_paths: RepositoryPaths, package_ahriman: Packag
|
|||||||
unlink_mock = mocker.patch("pathlib.Path.unlink")
|
unlink_mock = mocker.patch("pathlib.Path.unlink")
|
||||||
symlink_mock = mocker.patch("pathlib.Path.symlink_to")
|
symlink_mock = mocker.patch("pathlib.Path.symlink_to")
|
||||||
|
|
||||||
TreeMigrate.fix_symlinks(repository_paths)
|
TreeMigrate.symlinks_fix(repository_paths)
|
||||||
unlink_mock.assert_called_once_with()
|
unlink_mock.assert_called_once_with()
|
||||||
symlink_mock.assert_called_once_with(
|
symlink_mock.assert_called_once_with(
|
||||||
Path("..") /
|
Path("..") /
|
||||||
|
|||||||
Reference in New Issue
Block a user