def _run_subprocess(cls, args_list): proc = subprocess.run(args_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) utils.log_error(args_list, proc.stderr, proc.returncode) if proc.stderr or proc.returncode != 0: raise RuntimeError( "ERROR running process: %s, error = %s and exit code = %s" % (args_list, proc.stderr, proc.returncode)) return proc.stdout
def test_logging_4(self): with mock.patch('checks.utils.logging.error') as mock_logging: utils.log_error('samtools quickcheck', "error", 0) mock_logging.assert_called_once_with('samtools quickcheck had exit status 0, but threw an error: error ')
def test_logging_3(self): with mock.patch('checks.utils.logging.error') as mock_logging: utils.log_error('samtools quickcheck', "error", 1) mock_logging.assert_called_once_with('samtools quickcheck exited with code: 1 and threw an error: error ')
def test_logging_2(self): with mock.patch('checks.utils.logging.error') as mock_logging: utils.log_error('samtools quickcheck', None, 1) mock_logging.assert_called_once_with('samtools quickcheck had no error, but exit code is non zero: 1')
def test_logging_1(self): with mock.patch('checks.utils.logging.info') as mock_logging: utils.log_error('samtools quickcheck', None, 0) mock_logging.assert_called_once_with('Ran successfully samtools quickcheck')
def _run_subprocess(cls, args_list): proc = subprocess.run(args_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) utils.log_error(args_list, proc.stderr, proc.returncode) if proc.stderr or proc.returncode != 0: raise RuntimeError("ERROR running process: %s, error = %s and exit code = %s" % (args_list, proc.stderr, proc.returncode)) return proc.stdout
def test_logging_4(self): with mock.patch('checks.utils.logging.error') as mock_logging: utils.log_error('samtools quickcheck', "error", 0) mock_logging.assert_called_once_with( 'samtools quickcheck had exit status 0, but threw an error: error ' )
def test_logging_3(self): with mock.patch('checks.utils.logging.error') as mock_logging: utils.log_error('samtools quickcheck', "error", 1) mock_logging.assert_called_once_with( 'samtools quickcheck exited with code: 1 and threw an error: error ' )
def test_logging_2(self): with mock.patch('checks.utils.logging.error') as mock_logging: utils.log_error('samtools quickcheck', None, 1) mock_logging.assert_called_once_with( 'samtools quickcheck had no error, but exit code is non zero: 1' )
def test_logging_1(self): with mock.patch('checks.utils.logging.info') as mock_logging: utils.log_error('samtools quickcheck', None, 0) mock_logging.assert_called_once_with( 'Ran successfully samtools quickcheck')