Add basic public API tests to test_python_api.py (#114)

This commit is contained in:
Emir Belkahia
2026-02-12 11:35:29 +01:00
committed by GitHub
parent 431878c0db
commit a8c735a9a4
+26
View File
@@ -0,0 +1,26 @@
"""Tests for the public Python API surface."""
import pocket_tts
from pocket_tts import TTSModel
from pocket_tts.models.tts_model import TTSModel as TTSModelImpl
def test_public_api_exports_only_tts_model():
assert pocket_tts.__all__ == ["TTSModel"]
def test_public_api_tts_model_points_to_implementation():
assert TTSModel is TTSModelImpl
def test_public_api_expected_methods_and_properties():
for method_name in (
"load_model",
"generate_audio",
"generate_audio_stream",
"get_state_for_audio_prompt",
):
assert callable(getattr(TTSModel, method_name))
for property_name in ("device", "sample_rate"):
assert isinstance(getattr(TTSModel, property_name), property)