def test_set_filetype(editor, vim): editor.set_filetype('package_info') editor.set_filetype('package_info', 3) assert vim.mock_calls == [ call.command('set filetype=package_info'), call.command('3bufdo set filetype=package_info'), ]
def test_write(editor, vim): editor.write() editor.write(noautocmd=True) assert vim.mock_calls == [ call.command('write'), call.command('noautocmd write'), ]
def test_doautocmd(editor, vim): editor.doautocmd('BufLeave') editor.doautocmd('BufReadPre', 'BufRead', 'BufEnter') assert vim.mock_calls == [ call.command('doautocmd BufLeave'), call.command('doautocmd BufReadPre,BufRead,BufEnter'), ]
def test_creates_file_splits(self, editor, vim): editor.split_window('foo.scala') editor.split_window('foo.scala', vertical=True) assert vim.mock_calls == [ call.command('split foo.scala'), call.command('vsplit foo.scala'), ]
def test_creates_empty_splits(self, editor, vim): editor.split_window(None) editor.split_window(None, vertical=True) assert vim.mock_calls == [call.command('new'), call.command('vnew')]