runtime_test.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:treadmill 作者: Morgan-Stanley 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号