コード例 #1
0
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'),
    ]
コード例 #2
0
def test_write(editor, vim):
    editor.write()
    editor.write(noautocmd=True)

    assert vim.mock_calls == [
        call.command('write'),
        call.command('noautocmd write'),
    ]
コード例 #3
0
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'),
    ]
コード例 #4
0
    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'),
        ]
コード例 #5
0
    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')]