Replace Deck video generation with selected external service lifecycle
This commit is contained in:
@@ -48,3 +48,14 @@ class DockerTests(unittest.TestCase):
|
||||
manager=Manager(d,True);manager.job={'state':'running'}
|
||||
with patch('deploy.docker_helper.release',return_value={'VERSION_ID':'13'}),patch('deploy.docker_helper.run',return_value=Mock(stdout='amd64')),patch.object(manager,'_checked',side_effect=ValueError('failed')):manager._install()
|
||||
self.assertEqual(manager.job['state'],'failed')
|
||||
|
||||
def test_video_controller_only_uses_registered_container_and_refuses_busy_gpu(self):
|
||||
with tempfile.TemporaryDirectory() as d:
|
||||
manager=Manager(d);config=dict(id='ltx',name='LTX',container_id='a'*64)
|
||||
with patch.object(manager,'video_configs',return_value=[config]),patch.object(manager,'video_status',return_value={'running':False}),patch('deploy.docker_helper.run',return_value=Mock(returncode=0,stdout='1234')) as run:
|
||||
with self.assertRaises(ValueError):manager.dispatch({'action':'video-start','service':'ltx'})
|
||||
self.assertFalse(any('start' in c.args[0] for c in run.call_args_list))
|
||||
with self.assertRaises(ValueError):manager.dispatch({'action':'video-stop','service':'arbitrary'})
|
||||
with patch.object(manager,'video_configs',return_value=[config]),patch.object(manager,'video_status',return_value={'running':False}),patch('deploy.docker_helper.run',return_value=Mock(returncode=0,stdout='')) as run:
|
||||
manager.dispatch({'action':'video-start','service':'ltx'})
|
||||
self.assertEqual(run.call_args.args[0],['/usr/bin/docker','start','a'*64])
|
||||
|
||||
Reference in New Issue
Block a user