Skip to main content
Glama

NijiVoice-MCP

by ryoooo
README.md2.03 kB
# にじボイスMCP テストスイート このディレクトリには、にじボイスMCPのテストコードが含まれています。 ## テストの実行方法 プロジェクトのルートディレクトリから以下のコマンドを実行します: ```bash # 全てのテストを実行 uv run pytest # 特定のテストファイルのみ実行 uv run pytest tests/test_api.py # 特定のテスト関数のみ実行 uv run pytest tests/test_server.py::test_get_voice_actors # カバレッジレポート付きで実行 uv run pytest --cov=nijivoice --cov=server ``` ## テスト構成 - `tests/conftest.py` - Pytestの設定ファイル - `tests/mock_client.py` - テスト用のモックNijiVoiceクライアント - `tests/test_api.py` - `nijivoice/api.py`のテスト - `tests/test_exceptions.py` - `nijivoice/exceptions.py`のテスト - `tests/test_models.py` - `nijivoice/models.py`のテスト - `tests/test_server.py` - `server.py`のテスト ## モック テストでは、外部サービスへの依存を避けるために、`MockNijiVoiceClient`クラスを使用しています。このクラスは以下の機能を提供します: - 事前定義されたVoice Actor一覧の返却 - 音声生成リクエストの模擬 - クレジット残高取得の模擬 - API失敗の模擬 (`set_should_fail`メソッドを使用) ## 非同期テスト このプロジェクトは非同期処理を多用しているため、以下の点に注意してください: - `pytest.mark.asyncio`デコレータを使用して非同期テストを記述します - `pytest.ini`に`asyncio_mode = strict`が設定されています - 非同期モックには`AsyncMock`を使用してください ## カバレッジレポート 詳細なHTMLカバレッジレポートを生成するには: ```bash uv run pytest --cov=nijivoice --cov=server --cov-report=html ``` これにより、カバレッジ情報を含むHTMLファイルが入った`htmlcov`ディレクトリが作成されます。

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ryoooo/nijivoice-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server