feat: build update-swarm jobs.json from vault notes

This commit is contained in:
ginnoir committed 2026-08-14 14:47:18 -05:00
1 parent 299b01c4fd
commit d91b0bc13d
7 files changed
+109

No files matched your search

@@ -0,0 +1,3 @@
| Hack | Vault note |
|---|---|
| **DemoOnly** | [[DemoOnly]] |
@@ -0,0 +1,8 @@
---
title: "Pokémon DemoOnly"
platform: PC
version: "0.6.2"
status: Beta
---
# Pokémon DemoOnly
@@ -0,0 +1,11 @@
---
title: "Pokémon FakeHack"
platform: GBA
version: "1.0.0"
status: Complete
library_path: "/storage1/Emulation/roms/gba/Pokemon - FakeHack [Hack].gba"
homepage: "https://example.com/fake"
source: "https://www.pokecommunity.com/threads/fake.1/"
---
# Pokémon FakeHack
@@ -0,0 +1 @@
See [[FakeHack]] still gated.
+27
View File
@@ -0,0 +1,27 @@
import os, sys, tempfile, unittest
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
sys.path.insert(0, os.path.join(ROOT, "scripts"))
from update_swarm.jobs import build_jobs, init_run
FIXTURE = os.path.join(os.path.dirname(__file__), "fixtures", "vault", "Pokémon ROM Hacks")
class TestJobs(unittest.TestCase):
def test_flags_watchlist_and_wanted(self):
jobs = {j["stem"]: j for j in build_jobs(FIXTURE)}
self.assertIn("FakeHack", jobs)
self.assertTrue(jobs["FakeHack"]["wanted"])
self.assertFalse(jobs["FakeHack"]["watchlist"])
self.assertEqual(jobs["FakeHack"]["note_version"], "1.0.0")
self.assertTrue(jobs["DemoOnly"]["watchlist"])
self.assertFalse(jobs["DemoOnly"]["wanted"])
self.assertIsNone(jobs["DemoOnly"]["library_path"])
def test_init_run_creates_dirs(self):
with tempfile.TemporaryDirectory() as td:
run = os.path.join(td, "2026-08-14")
init_run(run)
for name in ("census", "scouts", "staging"):
self.assertTrue(os.path.isdir(os.path.join(run, name)))
if __name__ == "__main__":
unittest.main()