

def test_simple_echo_failure(self):
    with self.assertRaises(core.NonZeroReturnCodeError) as cm:
        core._create_result('cat non_existent_file', '')
    result = cm.exception.result
    self.assertNotEqual(result.returncode, 0)
    self.assertEqual(result.stdout, '')
    self.assertEqual(len(result.stdout_lines), 0)
    self.assertGreater(len(result.stderr), 0)
    self.assertGreater(len(result.stderr_lines), 0)
    self.assertEqual(len(self.stdout_mock.lines), 0)
    self.assertEqual(len(self.stderr_mock.lines), 0)

dataset/ETHPy150Open lamerman/shellpy/shellpython/tests/test_unix_core.py TestExecute.test_simple_echo_failure/original