def test_return_code_log_error_raise_runtime(self):
    self.mock_popen.return_value = ('', '')
    self.process.return_value.returncode = 1
    with mock.patch.object(utils, 'LOG') as log:
        self.assertRaises(RuntimeError, utils.execute, ['ls'])
        self.assertTrue(log.error.called)
def test_return_code_log_error_raise_runtime(self):
    self.mock_popen.return_value = (, )
    self.process.return_value.returncode = 1
    with mock.patch.object(utils, 'LOG') as log:
        self.assertRaises(RuntimeError, utils.execute, ['ls'])
        self.assertTrue(log.error.called)