Shenrui-Ma/video-regen-recipes / templates/character-short/bit-by-bit-heartache
bit-by-bit-heartache
Verified用角色参考图在本机制作 Heartache 连续动作配乐短片.
tests/test_prepare_driver.py
View on GitHubimport importlib.util
from pathlib import Path
import unittest
RECIPE = Path(__file__).resolve().parents[1]
SCRIPT = RECIPE / 'scripts/prepare_driver.py'
class DriverContractTests(unittest.TestCase):
def load_helper(self):
self.assertTrue(SCRIPT.is_file(), 'Missing checked historical-driver preparation helper')
spec = importlib.util.spec_from_file_location('prepare_driver', SCRIPT)
assert spec is not None and spec.loader is not None
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
def test_rejects_578_frame_reconstruction_instead_of_silently_trimming(self):
m = self.load_helper()
good = {'frames': 577, 'width': 1344, 'height': 768, 'fps': '24/1'}
m.validate_master(good, m.EXPECTED_SHA256)
for key, value in [('frames', 578), ('width', 1280), ('fps', '25/1')]:
with self.subTest(key=key):
with self.assertRaises(ValueError):
m.validate_master(dict(good, **{key: value}), m.EXPECTED_SHA256)
with self.assertRaises(ValueError):
m.validate_master(good, '0' * 64)
def test_split_uses_historical_intervals_and_does_not_copy_reference_audio(self):
m = self.load_helper()
self.assertEqual(m.RANGES, [(0, 158), (151, 309), (302, 443), (436, 577)])
for start, end in m.RANGES:
args = m.segment_command('ffmpeg', Path('space in/input.mp4'), Path('out.mp4'), start, end)
self.assertIn('-n', args)
self.assertNotIn('-y', args)
self.assertIn('-an', args)
self.assertIn(f'trim=start_frame={start}:end_frame={end},setpts=PTS-STARTPTS', args)
self.assertIn('space in/input.mp4', args)
self.assertEqual(args[args.index('-crf') + 1], '0')
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 |