예제 #1
0
    def test_run_backend_keyboard_interrupt(self, mc_be, mc_daemon_context, capsys):
        mc_be.return_value.run.side_effect = KeyboardInterrupt()

        with pytest.raises(KeyboardInterrupt):
            run_backend(self.run_opts)

        stdout, stderr = capsys.readouterr()
        assert "Killing/Dying" in stderr
예제 #2
0
    def test_run_backend_keyboard_interrupt(self, mc_be, mc_daemon_context, capsys):
        mc_be.return_value.run.side_effect = KeyboardInterrupt()

        with pytest.raises(KeyboardInterrupt):
            run_backend(self.run_opts)

        stdout, stderr = capsys.readouterr()
        assert "Killing/Dying" in stderr
예제 #3
0
    def test_run_backend_basic(self, mc_be, mc_daemon_context):
        self.grp.getgrnam.return_value.gr_gid = 7
        self.pwd.getpwnam.return_value.pw_uid = 9

        run_backend(self.run_opts)
        ddc = mc_daemon_context.call_args[1]
        assert ddc["signal_map"] == {1: u'terminate', 15: u'terminate'}
        assert ddc["umask"] == 0o22
        assert ddc["gid"] == 7
        assert ddc["uid"] == 9
        assert ddc["stderr"] == sys.stderr

        assert mc_be.called
        expected_call = mock.call(self.config_file, ext_opts=self.run_opts)
        assert mc_be.call_args == expected_call
예제 #4
0
    def test_run_backend_basic(self, mc_be, mc_daemon_context):
        self.grp.getgrnam.return_value.gr_gid = 7
        self.pwd.getpwnam.return_value.pw_uid = 9

        run_backend(self.run_opts)
        ddc = mc_daemon_context.call_args[1]
        assert ddc["signal_map"] == {1: u'terminate', 15: u'terminate'}
        assert ddc["umask"] == 0o22
        assert ddc["gid"] == 7
        assert ddc["uid"] == 9
        assert ddc["stderr"] == sys.stderr

        assert mc_be.called
        expected_call = mock.call(self.config_file, ext_opts=self.run_opts)
        assert mc_be.call_args == expected_call
예제 #5
0
파일: copr_be.py 프로젝트: schlupov/copr
def main(args):
    opts = parse_args(args)
    run_backend(opts)
예제 #6
0
파일: copr_be.py 프로젝트: 0-T-0/copr
def main(args):
    opts = parse_args(args)
    run_backend(opts)