Select the single active video profile through endpoint publication
This commit is contained in:
@@ -72,6 +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_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')]))
|
||||
|
||||
Reference in New Issue
Block a user