From a8c735a9a4c3cd49a150a160098dd84197d4e2c5 Mon Sep 17 00:00:00 2001 From: Emir Belkahia <151930530+emirbelkahia@users.noreply.github.com> Date: Thu, 12 Feb 2026 11:35:29 +0100 Subject: [PATCH] Add basic public API tests to test_python_api.py (#114) --- tests/test_python_api.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/test_python_api.py b/tests/test_python_api.py index e69de29..5740d7d 100644 --- a/tests/test_python_api.py +++ b/tests/test_python_api.py @@ -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)