mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 01:53:56 -06:00
fix: skip the core-info row when offline
This commit is contained in:
1 parent
f195e714c4
commit
651b1404db
2 files changed
+12
No files matched your search
@@ -822,6 +822,9 @@ def check_coreinfo(
|
||||
record_path: Path = CORE_INFO_RECORD,
|
||||
) -> list[Finding]:
|
||||
blobs = core_info_blobs(cache_dir, offline)
|
||||
if blobs is None and offline:
|
||||
# Offline with no cached listing, nothing was asked of the upstream.
|
||||
return [Finding("coreinfo", "libretro-core-info", SKIPPED, detail="offline")]
|
||||
if blobs is None:
|
||||
return [Finding("coreinfo", "libretro-core-info", UNKNOWN, detail="listing unavailable")]
|
||||
names = list(blobs)
|
||||
|
||||
@@ -310,6 +310,15 @@ class CoreResolutionTests(unittest.TestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
cf.record_core_info({"a": "2"}, ["ghost"], record)
|
||||
|
||||
def test_offline_without_a_cached_listing_is_skipped(self):
|
||||
"""Offline, the row read UNKNOWN and failed the run as an upstream
|
||||
that could not be read, though nothing was asked of it."""
|
||||
with mock.patch.object(cf, "core_info_blobs", return_value=None):
|
||||
(row,) = cf.check_coreinfo(self.PROFILES, "", True)
|
||||
self.assertEqual((row.status, row.detail), (cf.SKIPPED, "offline"))
|
||||
(row,) = cf.check_coreinfo(self.PROFILES, "", False)
|
||||
self.assertEqual(row.status, cf.UNKNOWN)
|
||||
|
||||
def test_the_committed_record_holds_git_blobs(self):
|
||||
recorded = cf.load_core_info_record()
|
||||
self.assertIsNotNone(recorded)
|
||||
|
||||
Reference in new issue
Block a user