feat: build update-swarm jobs.json from vault notes
This commit is contained in:
1 parent
299b01c4fd
commit
d91b0bc13d
7 files changed
+109
No files matched your search
@@ -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()
|
||||
Reference in new issue
Block a user