From 021abfd297d0ed50a28abdee58b3152d6804045a Mon Sep 17 00:00:00 2001 From: Yandrik Date: Thu, 25 Apr 2024 15:43:32 +0200 Subject: [PATCH] test: add empty api keys to audiogen test --- test_audiogen_validate.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test_audiogen_validate.py b/test_audiogen_validate.py index b8aaf2a..072dd2d 100644 --- a/test_audiogen_validate.py +++ b/test_audiogen_validate.py @@ -14,7 +14,7 @@ class TestAudioGeneratorValidate(TestCase): {"type": "section_end"}, {"type": "insert_section", "section_id": 1}, ] - self.audio_generator = AudioGenerator(self.valid_parsed_data, "test_output.mp3") + self.audio_generator = AudioGenerator(self.valid_parsed_data, "test_output.mp3", api_key="") def test_validate_voices_valid(self): self.audio_generator.validate_voices() @@ -25,7 +25,7 @@ class TestAudioGeneratorValidate(TestCase): {"type": "voice", "voice": "invalid_voice"}, {"type": "text", "text": "Hello, world!"}, ] - invalid_audio_generator = AudioGenerator(invalid_parsed_data, "test_output.mp3") + invalid_audio_generator = AudioGenerator(invalid_parsed_data, "test_output.mp3", api_key="") with self.assertRaises(ValueError) as cm: invalid_audio_generator.validate_voices() self.assertEqual(str(cm.exception), "Invalid voice(s) found: invalid_voice") @@ -40,12 +40,13 @@ class TestAudioGeneratorValidate(TestCase): {"type": "text", "text": "Hello, world!"}, {"type": "insert_section", "section_id": 1}, ] - invalid_audio_generator = AudioGenerator(invalid_parsed_data, "test_output.mp3") + invalid_audio_generator = AudioGenerator(invalid_parsed_data, "test_output.mp3", api_key="") with self.assertRaises(ValueError) as cm: invalid_audio_generator.validate_sections() self.assertIn("Section 1 is used before being defined.", str(cm.exception)) self.assertIn("Undefined section(s) used: 1", str(cm.exception)) + # @patch('builtins.input', return_value='no') # @patch('audiogen.AudioGenerator.text_to_speech') # def test_text_to_speech_retry_logic(self, mock_text_to_speech, mock_input):