test_pipeline.py 文件源码

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

项目:slurm-pipeline 作者: acorg 项目源码 文件源码
def testCwdWithRelativeScriptPath(self, isdirMock, existsMock, accessMock,
                                      subprocessMock):
        """
        If a step has a cwd set and its script is a relative path, the path of
        the executed script that is executed must be as specified (not
        converted to an absolute path).
        """
        subprocessMock.return_value = ''

        sp = SlurmPipeline(
            {
                'steps': [
                    {
                        'cwd': '/tmp',
                        'name': 'name1',
                        'script': 'script1',
                    },
                ],
            })
        sp.schedule()

        subprocessMock.assert_has_calls([
            call(['script1'], cwd='/tmp', universal_newlines=True,
                 stdin=DEVNULL, env=ANY),
        ])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号