Fix tests

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
Mazz Mosley 2015-10-26 10:27:57 +00:00 committed by Daniel Nephin
parent d6fa8596d2
commit da41ed22f9
4 changed files with 4 additions and 5 deletions

View File

@ -362,6 +362,7 @@ class ServiceTest(DockerClientTestCase):
new_container, = service.execute_convergence_plan(
ConvergencePlan('recreate', [old_container]))
self.assertEqual(list(new_container.get('Volumes')), ['/data'])
self.assertEqual(new_container.get('Volumes')['/data'], volume_path)

View File

@ -185,8 +185,7 @@ def converge(service,
do_build=True):
"""Create a converge plan from a strategy and execute the plan."""
plan = service.convergence_plan(strategy)
containers, logging_threads = zip(*service.execute_convergence_plan(plan, do_build=do_build, timeout=1))
return containers
return service.execute_convergence_plan(plan, do_build=do_build, timeout=1)
class ServiceStateTest(DockerClientTestCase):

View File

@ -16,6 +16,7 @@ def build_mock_container(reader):
name='myapp_web_1',
name_without_project='web_1',
has_api_logs=True,
log_stream=None,
attach=reader,
wait=mock.Mock(return_value=0),
)

View File

@ -323,9 +323,7 @@ class ServiceTest(unittest.TestCase):
new_container = service.recreate_container(mock_container)
mock_container.stop.assert_called_once_with(timeout=10)
self.mock_client.rename.assert_called_once_with(
mock_container.id,
'%s_%s' % (mock_container.short_id, mock_container.name))
mock_container.rename_to_tmp_name.assert_called_once_with()
new_container.start.assert_called_once_with()
mock_container.remove.assert_called_once_with()