예제 #1
0
    def test_sends_signal(self, mock_os, *_):
        """Tests that signal is sent to process.."""
        process = Process('cmd')
        mock_process = mock.Mock()
        mock_process.pid = -1
        process._process = mock_process

        process.signal(51641)

        mock_os.assert_called_with(-1, 51641)
예제 #2
0
    def test_signal_raises_error_on_windows(self, *_):
        """Tests that signaling is unsupported in windows with appropriate
        error msg."""
        process = Process('cmd')
        mock_inner_process = mock.Mock()
        mock_inner_process.pid = -1
        process._process = mock_inner_process

        with mock.patch('acts.libs.proc.process._on_windows', True):
            with self.assertRaises(ProcessError):
                process.signal(51641)