"""외부 provider 대신 작은 PCM fixture로 실패·복구·원자 공개 계약을 검증한다. 실제 네트워크 생성은 별도 인수 단계에서 101개 전부 실행한다. 이 테스트의 가짜 MP3는 adapter 경계용이며 public 자산이나 생성 evidence로 쓰지 않는다. """ import contextlib import hashlib import importlib.util import io import json import math from pathlib import Path import struct import subprocess import sys import tempfile import unittest from unittest.mock import patch import wave ROOT = Path(__file__).resolve().parents[2] sys.path.insert(0, str(ROOT / "scripts")) import neural_audio as audio ENTRIES = [{"file": "intro.wav", "text": "안내 문장"}] + [ {"file": f"target-{i}.wav", "text": f"목표 문장 {i}"} for i in range(100) ] VERSIONS = {"edge-tts": "7.3.1", "ffmpeg": "ffmpeg version fixture"} def wav(path, *, rate=24000, channels=1, width=2, duration=1, amplitude=4000): values = [int(amplitude * math.sin(2 * math.pi * 220 * i / rate)) for i in range(int(rate * duration))] with wave.open(str(path), "wb") as stream: stream.setparams((channels, width, rate, 0, "NONE", "not compressed")) stream.writeframes(b"".join(struct.pack("