chore: move new tests onto the shared test helpers

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:05:48 +01:00
1 parent 98775b7e4d
commit 589174c369
4 files changed
+5 -5

No files matched your search

+2 -2
View File
@@ -965,7 +965,7 @@ class AutoFetchReadsListsAndPlacesWithoutClobbering(unittest.TestCase):
"""'ds' is in '3DS': the DS firmware went to Nintendo/3DS."""
from scripts.acquire import fetch as acquire_fetch
with tempfile.TemporaryDirectory(dir=TMP_ROOT) as directory:
with tempfile.TemporaryDirectory() as directory:
bios = Path(directory)
for folder in ("Nintendo/3DS", "Nintendo/Nintendo DS"):
(bios / folder).mkdir(parents=True)
@@ -982,7 +982,7 @@ class AutoFetchReadsListsAndPlacesWithoutClobbering(unittest.TestCase):
from scripts.acquire import fetch as acquire_fetch
with tempfile.TemporaryDirectory(dir=TMP_ROOT) as directory:
with tempfile.TemporaryDirectory() as directory:
bios, acquired = Path(directory, "bios"), Path(directory, "acquire")
bios.mkdir()
with mock.patch.object(acquire_fetch, "ACQUIRE_DIR", acquired), \
+1 -1
View File
@@ -568,7 +568,7 @@ class AMissingDestIsSaid(unittest.TestCase):
def test_only_y_or_yes_creates_the_folders(self):
# A default-no question read "yeah" as yes, as no other one does.
root = Path(_tempdir(self))
root = scratch_dir(self)
self.assertEqual(self._call(root / "a" / "b", True, "yeah")[1], 2)
self.assertFalse((root / "a").exists())
+1 -1
View File
@@ -158,7 +158,7 @@ class AVariantCopyIsAnArchive(unittest.TestCase):
container = f"{zlib.crc32(copy.read_bytes()):08x}"
db = {"files": {"s": {"path": str(copy), "crc32": container}}}
pool = AtomPool(bios, db=db)
self.assertEqual(pool.read(_crc(ROM_A)), ROM_A)
self.assertEqual(pool.read(loopback.crc(ROM_A)), ROM_A)
self.assertNotIn(container, pool)
+1 -1
View File
@@ -134,7 +134,7 @@ class SourceRevisionReadsEveryShape(unittest.TestCase):
them so, the scrapers' required_revision did not."""
url = "https://raw.githubusercontent.com/ROCKNIX/distribution/20250101/f"
self.assertEqual(required_revision(url, "rocknix/distribution"), "20250101")
with tempfile.TemporaryDirectory(dir=TMP_ROOT) as tmp:
with tempfile.TemporaryDirectory() as tmp:
path = Path(tmp, "p.yml")
path.write_text(f"source: {url}\n")
self.assertEqual(scraped_revision(path, "rocknix/Distribution"), "20250101")