def test__finish_no_info(self):
"""Tests docker runtime finish when not aborted or exited."""
# Access to a protected member
# pylint: disable=W0212
treadmill.runtime.save_app(self.manifest, self.data_dir)
client = mock.MagicMock()
docker.from_env.return_value = client
container = mock.MagicMock()
client.containers.get.return_value = container
type(container).attrs = mock.PropertyMock(return_value={
'State': None
})
docker_runtime = runtime.DockerRuntime(self.tm_env, self.container_dir)
# Should not throw any exception
docker_runtime._finish()
评论列表
文章目录