mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 13:33:24 -05:00
fix: arbitrate slots on the strongest profile proof
This commit is contained in:
1 parent
2cafeb1d33
commit
619c282477
2 files changed
+46
-4
No files matched your search
@@ -555,5 +555,25 @@ class ManifestFollowsTheArbitration(unittest.TestCase):
|
||||
self.assertEqual(by_dest[dest]["repo_path"], path)
|
||||
|
||||
|
||||
class StrongestProfileClaimWins(unittest.TestCase):
|
||||
"""yaps2 pins GameIndex.yaml by sha1; armsx2 matched a path only."""
|
||||
|
||||
def test_hash_proof_beats_path_proof(self):
|
||||
from slots import Claim, Conflict, arbitrate, format_decision
|
||||
|
||||
def claim(emu, path, status):
|
||||
return Claim("profile", "pcsx2/resources/GameIndex.yaml", "GameIndex.yaml",
|
||||
emulator=emu, local_path=path, status=status)
|
||||
|
||||
conflict = Conflict(
|
||||
"pcsx2/resources/GameIndex.yaml",
|
||||
Claim("platform", "pcsx2/resources/GameIndex.yaml", "GameIndex.yaml",
|
||||
local_path="p", status="path_exact"),
|
||||
[claim("armsx2", "a", "path_exact"), claim("yaps2", "y", "sha1_exact")],
|
||||
)
|
||||
decision = arbitrate(conflict, "existence")
|
||||
self.assertEqual(decision.winner.emulator, "yaps2")
|
||||
self.assertIn("armsx2 expected another file", format_decision(decision))
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user