Also do the same for last_pipe_status

This commit is contained in:
ZyX 2013-04-02 19:06:05 +04:00
parent 4e5bd54f79
commit 691efbfc9b
2 changed files with 6 additions and 5 deletions

View File

@ -22,7 +22,7 @@ def last_pipe_status(pl, segment_info):
''' '''
last_pipe_status = segment_info['args'].last_pipe_status last_pipe_status = segment_info['args'].last_pipe_status
if any(last_pipe_status): if any(last_pipe_status):
return [{"contents": str(status), "highlight_group": "exit_fail" if status else "exit_success"} return [{'contents': str(status), 'highlight_group': 'exit_fail' if status else 'exit_success', 'draw_inner_divider': True}
for status in last_pipe_status] for status in last_pipe_status]
else: else:
return None return None

View File

@ -29,10 +29,11 @@ class TestShell(TestCase):
segment_info['args'].last_pipe_status = [0, 0, 0] segment_info['args'].last_pipe_status = [0, 0, 0]
self.assertEqual(shell.last_pipe_status(pl=pl, segment_info=segment_info), None) self.assertEqual(shell.last_pipe_status(pl=pl, segment_info=segment_info), None)
segment_info['args'].last_pipe_status = [0, 2, 0] segment_info['args'].last_pipe_status = [0, 2, 0]
self.assertEqual(shell.last_pipe_status(pl=pl, segment_info=segment_info), self.assertEqual(shell.last_pipe_status(pl=pl, segment_info=segment_info), [
[{'contents': '0', 'highlight_group': 'exit_success'}, {'contents': '0', 'highlight_group': 'exit_success', 'draw_inner_divider': True},
{'contents': '2', 'highlight_group': 'exit_fail'}, {'contents': '2', 'highlight_group': 'exit_fail', 'draw_inner_divider': True},
{'contents': '0', 'highlight_group': 'exit_success'}]) {'contents': '0', 'highlight_group': 'exit_success', 'draw_inner_divider': True}
])
class TestCommon(TestCase): class TestCommon(TestCase):