1
0

webcam copy

This commit is contained in:
Aiden
2026-05-27 12:17:12 +10:00
parent c0304c575c
commit 21f0e455ee
6 changed files with 410 additions and 9 deletions

View File

@@ -45,6 +45,45 @@ class SerialScenarioTest(unittest.TestCase):
self.assertEqual(DEFAULT_ACK_TARGET, bytes.fromhex("07804020902D"))
self.assertEqual(DEFAULT_ACK_FRAME, bytes.fromhex("05004000001F"))
def test_dry_run_summarizes_webcam_snapshot_options(self):
scenario = {
"name": "unit-camera",
"steps": [
{
"action": "send",
"label": "camera_test",
"frame": "00 00 00 80 80 5A",
}
],
}
with tempfile.TemporaryDirectory() as tmpdir:
path = Path(tmpdir) / "scenario.json"
snapshot_dir = Path(tmpdir) / "shots"
path.write_text(json.dumps(scenario), encoding="utf-8")
stdout = io.StringIO()
exit_code = main(
[
str(path),
"--dry-run",
"--snapshot-dir",
str(snapshot_dir),
"--camera-index",
"1",
"--snapshot-before-send",
"--snapshot-delays",
"0,0.25,1",
],
stdout=stdout,
)
output = stdout.getvalue()
self.assertEqual(exit_code, 0)
self.assertIn(f"snapshots={snapshot_dir}", output)
self.assertIn("camera_index=1", output)
self.assertIn("before_send=1", output)
self.assertIn("delays=0,0.25,1", output)
if __name__ == "__main__":
unittest.main()