test Vim variant of stash segment

This commit is contained in:
XZS 2016-04-27 12:30:36 +02:00
parent e027c5ed47
commit f4cbeaff9b

View File

@ -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()