Skip to content

Commit

Permalink
Fix some test warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
paulovcmedeiros committed Feb 15, 2024
1 parent fa190bb commit 24b4ec1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyrobbot/sst_and_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SpeechAndTextConfigs:
general_token_usage_db: TokenUsageDatabase
token_usage_db: TokenUsageDatabase
engine: Literal["openai", "google"] = "google"
language: str = "en-US"
language: str = "en"
timeout: int = 10


Expand Down
2 changes: 1 addition & 1 deletion pyrobbot/voice_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class VoiceChat(Chat):

def __init__(self, configs: VoiceChatConfigs = default_configs):
"""Initializes a chat instance."""
_check_needed_imports()
super().__init__(configs=configs)
_check_needed_imports()

self.block_size = int((self.sample_rate * self.frame_duration) / 1000)

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_voice_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from pyrobbot.voice_chat import VoiceChat


def test_cannot_instanciate_assistant_is_soundcard_not_imported(mocker):
def test_cannot_instanciate_assistant_if_soundcard_not_imported(mocker):
"""Test that the voice chat cannot be instantiated if soundcard is not imported."""
mocker.patch("pyrobbot.voice_chat._sounddevice_imported", False)
with pytest.raises(ImportError, match="Module `sounddevice`"):
VoiceChat()
VoiceChat(configs=VoiceChatConfigs())


@pytest.mark.parametrize("param_name", ["sample_rate", "frame_duration"])
Expand Down

0 comments on commit 24b4ec1

Please sign in to comment.