mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-24 18:47:53 -06:00
refactor: read md5 lists through parse_hash_list
The RetroDECK and Recalbox exporters compare md5 lists with resolve.reconcile.hash_values, and the RetroDECK scraper reads an entry's md5 with md5_field and parse_hash_list instead of its own copy. Recalbox's comparison no longer keeps an empty item: md5="a,,b" states a,b where it stated ,a,b. The RetroDECK scraper now splits a comma-joined value and refuses an md5 that is neither a string nor a list of strings, as the batocera-systems readers do. The ten cached component manifests write neither form, so retrodeck.yml is unchanged.
This commit is contained in:
1 parent
e19025231e
commit
f7c08a6ca3
5 files changed
+50
-20
No files matched your search
@@ -82,5 +82,23 @@ class ManifestErrors(unittest.TestCase):
|
||||
self.fetch(None)
|
||||
|
||||
|
||||
|
||||
class ManifestMd5(unittest.TestCase):
|
||||
def test_a_string_or_a_list_gives_the_valid_values(self):
|
||||
from scripts.scraper.retrodeck_scraper import _entry_md5
|
||||
|
||||
md5 = "0123456789abcdef0123456789ABCDEF"
|
||||
self.assertEqual(_entry_md5(md5), md5.lower())
|
||||
self.assertEqual(_entry_md5([md5, "", "not an md5", md5]), md5.lower())
|
||||
self.assertEqual(_entry_md5(""), "")
|
||||
self.assertEqual(_entry_md5(None), "")
|
||||
|
||||
def test_a_value_of_another_type_is_refused(self):
|
||||
from scripts.scraper.retrodeck_scraper import _entry_md5
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
_entry_md5([1])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user