test: add empty api keys to audiogen test
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
7455b05c15
commit
021abfd297
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user