test: fix api key problem in test
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Yandrik 2024-04-25 15:44:37 +02:00
parent 021abfd297
commit c227957d97

View File

@ -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", api_key="")
self.audio_generator = AudioGenerator(self.valid_parsed_data, "test_output.mp3", api_key="abc")
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", api_key="")
invalid_audio_generator = AudioGenerator(invalid_parsed_data, "test_output.mp3", api_key="abc")
with self.assertRaises(ValueError) as cm:
invalid_audio_generator.validate_voices()
self.assertEqual(str(cm.exception), "Invalid voice(s) found: invalid_voice")
@ -40,7 +40,7 @@ class TestAudioGeneratorValidate(TestCase):
{"type": "text", "text": "Hello, world!"},
{"type": "insert_section", "section_id": 1},
]
invalid_audio_generator = AudioGenerator(invalid_parsed_data, "test_output.mp3", api_key="")
invalid_audio_generator = AudioGenerator(invalid_parsed_data, "test_output.mp3", api_key="abc")
with self.assertRaises(ValueError) as cm:
invalid_audio_generator.validate_sections()
self.assertIn("Section 1 is used before being defined.", str(cm.exception))