@mock.patch('compose.service.Container', autospec=True)
def test_recreate_container(self, _):
    mock_container = mock.create_autospec(Container)
    service = Service('foo', client=self.mock_client, image='someimage')
    service.image = (lambda : {'Id': 'abc123'})
    new_container = service.recreate_container(mock_container)
    mock_container.stop.assert_called_once_with(timeout=10)
    mock_container.rename_to_tmp_name.assert_called_once_with()
    new_container.start.assert_called_once_with()
    mock_container.remove.assert_called_once_with()
@mock.patch('compose.service.Container', autospec=True)
def test_recreate_container(self, _):
    mock_container = mock.create_autospec(Container)
    service = Service('foo', client=self.mock_client, image='someimage')
    service.image = (lambda : {'Id': 'abc123'})
    new_container = service.recreate_container(mock_container)
    mock_container.stop.assert_called_once_with(timeout=10)
    mock_container.rename_to_tmp_name.assert_called_once_with()
    new_container.start.assert_called_once_with()
    mock_container.remove.assert_called_once_with()