mirror of
https://github.com/powerline/powerline.git
synced 2025-07-21 12:54:58 +02:00
Also do the same for last_pipe_status
This commit is contained in:
parent
4e5bd54f79
commit
691efbfc9b
@ -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
|
||||||
|
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user