示例#1
0
 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
示例#2
0
 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 ')
示例#3
0
 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 ')
示例#4
0
 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')
示例#5
0
 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')
示例#6
0
 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
示例#7
0
 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 '
         )
示例#8
0
 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 '
         )
示例#9
0
 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'
         )
示例#10
0
 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')