"""Validation and text-handling tests for the aligner; they never load the model.""" import io import json import os import sys import unittest import wave import numpy as np sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) from fastapi.testclient import TestClient # noqa: E402 import app as aligner # noqa: E402 def wav_bytes(seconds=1.0, sr=16000): buf = io.BytesIO() with wave.open(buf, "wb") as w: w.setnchannels(1); w.setsampwidth(2); w.setframerate(sr) w.writeframes((np.zeros(int(seconds * sr))).astype("