Replace Deck video generation with selected external service lifecycle
This commit is contained in:
+8
-20
@@ -72,31 +72,19 @@ class EndpointTests(unittest.TestCase):
|
||||
self.assertEqual(self.worker.requests[-1].get('reasoning_effort'),'max' if effort=='ultra' else effort)
|
||||
for effort in ([],True,3,'invalid'):
|
||||
self.assertEqual(self.request('/v1/chat/completions',dict(model='alpha',messages=[dict(role='user',content='synthetic')],reasoning_effort=effort))[0],400)
|
||||
def test_video_publication_is_exclusive_and_can_be_removed(self):
|
||||
for name in ('v1','v2'):
|
||||
self.rows.append(dict(id=name,name=name,kind='video',runnable=True,blockers=[],parameters={},updated_at=1))
|
||||
video=SimpleNamespace(selected=None,status=lambda:{})
|
||||
video.select=lambda ident:setattr(video,'selected',ident)
|
||||
self.ep.video=video
|
||||
self.ep.enable({'id':'v1','enabled':True})
|
||||
self.assertEqual([p['id'] for p in self.ep.rows() if p['kind']=='video' and p['enabled']],['v1'])
|
||||
self.ep.enable({'id':'v2','enabled':True})
|
||||
self.assertEqual([p['id'] for p in self.ep.rows() if p['kind']=='video' and p['enabled']],['v2'])
|
||||
self.ep.enable({'id':'v1','enabled':False});self.assertEqual(video.selected,'v2')
|
||||
self.ep.enable({'id':'v2','enabled':False});self.assertIsNone(video.selected)
|
||||
self.ep.video=None
|
||||
def test_video_profiles_not_published(self):
|
||||
self.rows.append(dict(id='video-old',name='old',kind='video',runnable=True,blockers=[],parameters={},updated_at=1))
|
||||
self.assertFalse(any(p['kind']=='video' for p in self.ep.rows()))
|
||||
with self.assertRaises(ValueError):self.ep.enable({'id':'video-old','enabled':True})
|
||||
def test_video_mode_rejects_chat_without_starting_llama(self):
|
||||
self.ep.video=Mock();self.ep.scheduler.gpu_mode='video'
|
||||
code,body=self.request('/v1/chat/completions',dict(model='alpha',messages=[dict(role='user',content='synthetic')]))
|
||||
self.assertEqual(code,503);self.assertEqual(body['error']['code'],'video_mode_active');self.assertFalse(self.worker.started)
|
||||
self.ep.video=None
|
||||
def test_video_job_api_and_auth(self):
|
||||
self.ep.video=Mock();self.ep.video.generate.return_value={'id':'a'*32,'state':'running'}
|
||||
self.ep.video.status.return_value={'job':{'id':'a'*32,'state':'complete'}}
|
||||
self.assertEqual(self.request('/v1/videos',{'prompt':'synthetic'})[0],202)
|
||||
self.assertEqual(self.request('/v1/videos/'+'a'*32)[1]['state'],'complete')
|
||||
self.assertEqual(self.request('/v1/videos/'+'b'*32)[0],404)
|
||||
self.ep.video=None
|
||||
def test_video_api_redirect_is_explicit_not_translation(self):
|
||||
code,body=self.request('/v1/videos',{'prompt':'synthetic'})
|
||||
self.assertEqual(code,410);self.assertEqual(body['error']['code'],'use_ltx_api')
|
||||
|
||||
def test_stt_endpoint_multipart_and_publication(self):
|
||||
from test_stt import audio
|
||||
self.rows.append(dict(id='stt',name='stt',kind='stt',runnable=True,blockers=[],parameters={}))
|
||||
|
||||
Reference in New Issue
Block a user