Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions fish/fish_cli/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def _get_headers(self, extra: dict[str, str] | None = None) -> dict[str, str]:
"""Get request headers with authentication."""
if not self.api_token:
raise FishAuthError(
"API token not configured. "
"Set ACEDATACLOUD_API_TOKEN or use --token option."
"API token not configured. Set ACEDATACLOUD_API_TOKEN or use --token option."
)
headers = {
"accept": "application/json",
Expand Down
12 changes: 3 additions & 9 deletions fish/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ def test_tts_json(self, runner, mock_tts_response):
respx.post("https://api.acedata.cloud/fish/tts").mock(
return_value=Response(200, json=mock_tts_response)
)
result = runner.invoke(
cli, ["--token", "test-token", "tts", "Hello, world!", "--json"]
)
result = runner.invoke(cli, ["--token", "test-token", "tts", "Hello, world!", "--json"])
assert result.exit_code == 0
data = json.loads(result.output)
assert "audio_url" in data
Expand Down Expand Up @@ -226,9 +224,7 @@ def test_tts_async(self, runner, mock_tts_async_response):
route = respx.post("https://api.acedata.cloud/fish/tts").mock(
return_value=Response(200, json=mock_tts_async_response)
)
result = runner.invoke(
cli, ["--token", "test-token", "tts", "Hello", "--async", "--json"]
)
result = runner.invoke(cli, ["--token", "test-token", "tts", "Hello", "--async", "--json"])
assert result.exit_code == 0
sent = json.loads(route.calls[0].request.content)
assert sent["async"] is True
Expand All @@ -238,9 +234,7 @@ def test_tts_async_rich_output(self, runner, mock_tts_async_response):
respx.post("https://api.acedata.cloud/fish/tts").mock(
return_value=Response(200, json=mock_tts_async_response)
)
result = runner.invoke(
cli, ["--token", "test-token", "tts", "Hello", "--async"]
)
result = runner.invoke(cli, ["--token", "test-token", "tts", "Hello", "--async"])
assert result.exit_code == 0
assert "2725a2d3" in result.output

Expand Down