Shenrui-Ma/video-regen-recipes / templates/character-short/bit-by-bit-heartache
bit-by-bit-heartache
Verified用角色参考图在本机制作 Heartache 连续动作配乐短片.
tests/test_runtime_io.py
View on GitHubimport importlib
from pathlib import Path
import sys
import tempfile
import unittest
RUNTIME = Path(__file__).resolve().parents[1] / 'scripts/runtime'
sys.path.insert(0, str(RUNTIME))
class IOTests(unittest.TestCase):
def test_history_paths_and_pair_staging(self):
self.assertTrue((RUNTIME / 'local_io.py').exists(), 'safe local history staging missing')
m = importlib.import_module('local_io')
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp).resolve()
output = root / 'comfy/output'; output.mkdir(parents=True)
entry = {'filename': 'v.latent', 'subfolder': 'run', 'type': 'output'}
(output / 'run').mkdir()
(output / 'run/v.latent').write_bytes(b'fixture-video-not-real-latent')
outputs = {'61': {'latents': [entry]}}
self.assertEqual(m.history_file(outputs, '61', '.latent', root / 'comfy'), output / 'run/v.latent')
for replacement in [{'filename': '../v.latent'}, {'filename': 'x\\v.latent'}, {'subfolder': '../escape'}, {'subfolder': '/absolute'}, {'type': 'input'}, {'filename': 'C:v.latent'}]:
with self.assertRaises(ValueError):
m.history_file({'61': {'latents': [{**entry, **replacement}]}}, '61', '.latent', root / 'comfy')
outside = root / 'outside'; outside.mkdir()
(outside / 'v.latent').write_bytes(b'outside')
(output / 'link').symlink_to(outside, target_is_directory=True)
with self.assertRaises(ValueError):
m.history_file({'61': {'latents': [{**entry, 'subfolder': 'link'}]}}, '61', '.latent', root / 'comfy')
destination = root / 'comfy/input/run/v.latent'
digest = m.copy_verified(output / 'run/v.latent', destination)
self.assertEqual(digest, m.digest(destination))
self.assertEqual(m.copy_verified(output / 'run/v.latent', destination), digest)
destination.write_bytes(b'changed')
with self.assertRaises(ValueError): m.copy_verified(output / 'run/v.latent', destination)
if __name__ == '__main__': unittest.main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |