mirror of
https://github.com/powerline/powerline.git
synced 2025-07-24 22:36:01 +02:00
test Vim variant of stash segment
This commit is contained in:
parent
e027c5ed47
commit
f4cbeaff9b
@ -1413,6 +1413,30 @@ class TestVim(TestCase):
|
||||
{'divider_highlight_group': 'branch:divider', 'highlight_groups': ['branch_clean', 'branch'], 'contents': 'foo'}
|
||||
])
|
||||
|
||||
def test_stash(self):
|
||||
pl = Pl()
|
||||
create_watcher = get_fallback_create_watcher()
|
||||
with vim_module._with('buffer', '/foo') as segment_info:
|
||||
stash = partial(self.vim.stash, pl=pl, create_watcher=create_watcher, segment_info=segment_info)
|
||||
|
||||
def forge_stash(n):
|
||||
return replace_attr(self.vcs, 'guess', get_dummy_guess(stash=lambda: n))
|
||||
|
||||
with forge_stash(0):
|
||||
self.assertEqual(stash(), None)
|
||||
with forge_stash(1):
|
||||
self.assertEqual(stash(), [{
|
||||
'divider_highlight_group': 'stash:divider',
|
||||
'highlight_groups': ['stash'],
|
||||
'contents': '1'
|
||||
}])
|
||||
with forge_stash(2):
|
||||
self.assertEqual(stash(), [{
|
||||
'divider_highlight_group': 'stash:divider',
|
||||
'highlight_groups': ['stash'],
|
||||
'contents': '2'
|
||||
}])
|
||||
|
||||
def test_file_vcs_status(self):
|
||||
pl = Pl()
|
||||
create_watcher = get_fallback_create_watcher()
|
||||
|
Loading…
x
Reference in New Issue
Block a user