diff --git a/database/versions/279a949d81b6_2_1_1.py b/database/versions/279a949d81b6_2_1_1.py index 1c8256e7a..3391479f7 100644 --- a/database/versions/279a949d81b6_2_1_1.py +++ b/database/versions/279a949d81b6_2_1_1.py @@ -7,7 +7,7 @@ Create Date: 2025-02-14 19:02:24.989349 """ from app.adapters.cache.backends import configure_platform_cache -from app.application.torrent import clear_torrent_cache +from app.application.torrent.download import clear_torrent_cache # revision identifiers, used by Alembic. revision = '279a949d81b6' diff --git a/tests/test_architecture_dependencies.py b/tests/test_architecture_dependencies.py index d8af7768f..fe199f615 100644 --- a/tests/test_architecture_dependencies.py +++ b/tests/test_architecture_dependencies.py @@ -381,15 +381,19 @@ def test_application_torrent_uses_same_named_single_word_package() -> None: assert len(init_tree.body) == 1 root_imports: list[str] = [] - for path in APP_ROOT.rglob("*.py"): - if path.is_relative_to(APP_ROOT / "plugins"): - continue - tree = ast.parse(path.read_text(encoding="utf-8-sig"), filename=str(path)) - for node in ast.walk(tree): - if isinstance(node, ast.ImportFrom) and node.module == "app.application.torrent": - root_imports.append( - f"{path.relative_to(PROJECT_ROOT).as_posix()}:{node.lineno}" - ) + for root in (APP_ROOT, PROJECT_ROOT / "database"): + for path in root.rglob("*.py"): + if path.is_relative_to(APP_ROOT / "plugins"): + continue + tree = ast.parse(path.read_text(encoding="utf-8-sig"), filename=str(path)) + for node in ast.walk(tree): + if ( + isinstance(node, ast.ImportFrom) + and node.module == "app.application.torrent" + ): + root_imports.append( + f"{path.relative_to(PROJECT_ROOT).as_posix()}:{node.lineno}" + ) assert root_imports == []