test_maas_run_remote_scripts.py 文件源码

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

项目:maas 作者: maas 项目源码 文件源码
def test_run_script_timed_out_script(self):
        scripts_dir = self.useFixture(TempDirectory()).path
        script = make_script(scripts_dir=scripts_dir)
        self.mock_capture_script_output.side_effect = TimeoutExpired(
            [factory.make_name('arg') for _ in range(3)],
            script['timeout_seconds'])
        self.args.pop('status')

        self.assertFalse(run_script(script, scripts_dir))

        self.assertThat(self.mock_output_and_send, MockCallsMatch(
            call(
                'Starting %s' % script['msg_name'], status='WORKING',
                **self.args),
            call(
                'Timeout(%s) expired on %s' % (
                    str(timedelta(seconds=script['timeout_seconds'])),
                    script['msg_name']),
                files={
                    script['combined_name']: script['combined'].encode(),
                    script['stdout_name']: script['stdout'].encode(),
                    script['stderr_name']: script['stderr'].encode(),
                    script['result_name']: script['result'].encode(),
                }, status='TIMEDOUT', **self.args),
        ))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号