refactor: split resolve_local_file stages

This commit is contained in:
Abdessamad Derraz committed 2026-11-24 05:54:38 +01:00
1 parent 39a4c86917
commit 2d79a2e1b5
16 files changed
+690 -650

No files matched your search

+1 -1
View File
@@ -159,7 +159,7 @@ class HeldArchivesMatchTheirRecipes(unittest.TestCase):
bios = REPO_ROOT / "bios"
if not bios.is_dir() or not (REPO_ROOT / "recipes").is_dir():
self.skipTest("bios/ or recipes/ is not present")
from resolve.localfile import variant_base_name
from resolve.lookup import variant_base_name
from core.hashing import md5_composite_of
allowed = _allowed_members()
+3 -2
View File
@@ -7,7 +7,7 @@ import tests
import unittest
from pathlib import Path
from resolve.localfile import _casefold_name_index
from resolve.namestages import _casefold_name_index
REPO_ROOT = Path(__file__).resolve().parents[1]
@@ -54,7 +54,8 @@ class APrimaryUnderAnotherCasing(unittest.TestCase):
self.by_name.setdefault(name, []).append(sha1)
def _resolve(self, name: str) -> str:
from resolve.localfile import _casefold_name_index, resolve_local_file
from resolve.namestages import _casefold_name_index
from resolve.localfile import resolve_local_file
_casefold_name_index.clear()
db = {"files": self.files, "indexes": {"by_name": self.by_name, "by_md5": {},
+1 -1
View File
@@ -18,7 +18,7 @@ from pathlib import Path
from model.database import declared_records, record_for_hash, records_for_hash
from packs.crossref import entry_source
from packs.integrity import _repo_satisfies_declaration
from resolve.localfile import held_record_for
from resolve.lookup import held_record_for
from resolve.acceptance import _variant_candidates
SHA_A, SHA_B = "a" * 40, "b" * 40
+2 -2
View File
@@ -13,7 +13,7 @@ import tempfile
import unittest
from pathlib import Path
from resolve.localfile import _by_affinity
from resolve.namestages import _by_affinity
REPO_ROOT = Path(__file__).resolve().parents[1]
@@ -36,7 +36,7 @@ class DeclaredSizeOrders(unittest.TestCase):
class OwnerOutranksSharedTree(unittest.TestCase):
def test_the_owners_copy_beats_two_matching_segments(self):
"""armsx2's fxaa.fx lost to NetherSX2's under shaders/common/."""
from resolve.localfile import _by_affinity
from resolve.namestages import _by_affinity
paths = [
"bios/Other/nethersx2/assets/shaders/common/fxaa.fx",
+1 -1
View File
@@ -16,7 +16,7 @@ import unittest
from pathlib import Path
from probes.entries import held_file, held_variants
from resolve.localfile import variant_copies
from resolve.lookup import variant_copies
def _record(root: Path, path: str, body: bytes) -> tuple[str, dict]: