refactor: share the target scrapers' fetch and CLI

This commit is contained in:
Abdessamad Derraz committed 2026-11-18 13:38:44 +01:00
1 parent 6f8b8dedb2
commit 738bb5bc07
11 files changed
+82 -238

No files matched your search

+4 -4
View File
@@ -90,8 +90,8 @@ class FailedRequestsStopTheScrape(unittest.TestCase):
retropie_targets_scraper,
retroarch_targets_scraper,
):
with self.subTest(scraper=module.__name__), mock.patch.object(
module.urllib.request, "urlopen", _refuse
with self.subTest(scraper=module.__name__), mock.patch(
"urllib.request.urlopen", _refuse
), self.assertRaises(RuntimeError):
module.Scraper().fetch_targets()
@@ -107,8 +107,8 @@ class FailedRequestsStopTheScrape(unittest.TestCase):
return b"[]"
for module in (emudeck_targets_scraper, retropie_targets_scraper):
with self.subTest(scraper=module.__name__), mock.patch.object(
module.urllib.request, "urlopen", lambda *_a, **_k: _Empty()
with self.subTest(scraper=module.__name__), mock.patch(
"urllib.request.urlopen", lambda *_a, **_k: _Empty()
), self.assertRaises(RuntimeError):
module.Scraper().fetch_targets()