Add exclusive music GPU mode beside LLM and video

This commit is contained in:
Mikei386
2026-09-30 22:13:31 +02:00
parent 0ca40bc624
commit 3aa2301a53
12 changed files with 46 additions and 16 deletions
+12
View File
@@ -44,3 +44,15 @@ class VideoComfyTests(unittest.TestCase):
self.assertTrue(self.video.service_authenticated('Bearer synthetic-service-secret'))
self.assertFalse(self.video.service_authenticated('Bearer wrong'))
self.assertFalse(self.video.service_authenticated('Bearer ü'))
def test_music_switch_is_exclusive_and_returns_to_llm(self):
import threading
from types import SimpleNamespace
scheduler=SimpleNamespace(gpu_mode='llm',cv=threading.Condition(),active=0,tts_active=0,transition=False,key=('chat',))
self.video.scheduler=scheduler;self.video._stop=Mock();self.video._foreign_services=lambda:[]
self.video.music_profiles=lambda:[dict(id='music',name='YuE2')]
self.video.switch('music');self.video.thread.join(2)
self.assertEqual(scheduler.gpu_mode,'music');self.assertEqual(self.video.state,'ready');self.video.stop_owned.assert_called_once();self.video._stop.assert_called_once()
self.video.switch('llm');self.video.thread.join(2);self.assertEqual(scheduler.gpu_mode,'llm')
def test_music_requires_enabled_ready_profile(self):
with self.assertRaisesRegex(ValueError,'Musikprofil'):self.video.switch('music')