Skip to content

Commit 57f0167

Browse files
committed
Fix tests.
1 parent 4f14fde commit 57f0167

File tree

7 files changed

+135
-55
lines changed

7 files changed

+135
-55
lines changed

t/base.vim

Lines changed: 0 additions & 24 deletions
This file was deleted.

t/docs.vim

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
filetype plugin indent on
2-
set hidden
1+
source plugin/pymode.vim
32

43
describe 'docs'
54
before
6-
e t/test.py
7-
let g:pymode_test = 1
5+
set filetype=python
6+
end
7+
8+
after
9+
bd!
10+
bd!
811
end
912

1013
it 'pymode show docs'
11-
Pydoc def
14+
Expect g:pymode_doc == 1
15+
put = 'def'
16+
normal GK
17+
wincmd p
18+
Expect bufname('%') == "__doc__"
1219
Expect getline(1) == 'Function definitions'
20+
Expect &filetype == 'rst'
1321
end
1422

1523
end

t/ftplugin.vim

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
source plugin/pymode.vim
2+
3+
describe 'pymode-ftplugin'
4+
5+
before
6+
set filetype=python
7+
end
8+
9+
after
10+
bd!
11+
end
12+
13+
it 'pymode init'
14+
PymodePython import pymode
15+
end
16+
17+
end
18+

t/indent.vim

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
filetype plugin indent on
2-
set hidden
1+
source plugin/pymode.vim
2+
3+
describe 'indent'
34

4-
describe 'docs'
55
before
6-
e t/test.py
7-
let g:pymode_test = 1
6+
set ft=python
7+
source after/indent/python.vim
88
end
99

10-
it 'pymode indent loaded'
11-
Expect &indentexpr == 'pymode#indent#Indent(v:lnum)'
10+
after
11+
bd!
1212
end
1313

14-
after
15-
close
14+
it 'pymode indent loaded'
15+
Expect g:pymode_indent == 1
16+
Expect &expandtab == 1
17+
Expect &shiftround == 1
18+
Expect &autoindent == 1
19+
Expect &indentexpr == 'pymode#indent#get_indent(v:lnum)'
1620
end
1721

1822
end

t/lint.vim

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1-
filetype plugin indent on
2-
set hidden
1+
source plugin/pymode.vim
32

43
describe 'pymode check code'
54

65
before
7-
e t/test.py
6+
set ft=python
87
end
98

109
after
11-
close
10+
bd!
1211
end
1312

14-
it 'async'
15-
let g:pymode_lint_async = 1
16-
PyLint
17-
Expect getqflist() == []
18-
sleep 1
19-
call pymode#queue#Poll()
20-
Expect getqflist() == [{'lnum': 2, 'bufnr': 1, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': 0, 'type': 'E', 'pattern': '', 'text': 'W0612 local variable "test" is assigned to but never used [pyflakes]'}]
21-
end
22-
23-
it 'disable async'
24-
let g:pymode_lint_async = 0
25-
PyLint
26-
Expect getqflist() == [{'lnum': 2, 'bufnr': 1, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': 0, 'type': 'E', 'pattern': '', 'text': 'W0612 local variable "test" is assigned to but never used [pyflakes]'}]
13+
it 'pymode lint loaded'
14+
Expect g:pymode_lint == 1
2715
end
2816

2917
end

t/plugin.vim

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
describe 'pymode-plugin'
2+
3+
before
4+
source plugin/pymode.vim
5+
set filetype=python
6+
end
7+
8+
after
9+
bd!
10+
end
11+
12+
it 'pymode options'
13+
Expect g:pymode == 1
14+
Expect g:pymode_python == 'python'
15+
Expect g:pymode_paths == []
16+
Expect g:pymode_virtualenv == 1
17+
Expect g:pymode_run == 1
18+
Expect g:pymode_lint == 1
19+
Expect g:pymode_breakpoint == 1
20+
Expect g:pymode_doc == 1
21+
Expect g:pymode_indent == 1
22+
end
23+
24+
it 'pymode interpreter'
25+
PymodePython import vim
26+
PymodePython vim.current.buffer.append('test success')
27+
Expect getline('$') == 'test success'
28+
end
29+
30+
end
31+
32+
33+
describe 'pymode-python-disable'
34+
before
35+
let g:pymode_python = 'disable'
36+
source plugin/pymode.vim
37+
set filetype=python
38+
end
39+
40+
after
41+
bd!
42+
end
43+
44+
it 'pymode disable python'
45+
Expect g:pymode_doc == 0
46+
Expect g:pymode_lint == 0
47+
Expect g:pymode_path == 0
48+
Expect g:pymode_rope == 0
49+
Expect g:pymode_run == 0
50+
Expect g:pymode_virtualenv == 0
51+
end
52+
53+
end

t/syntax.vim

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
describe 'pymode-syntax'
2+
3+
before
4+
syntax on
5+
set filetype=python
6+
end
7+
8+
after
9+
bd!
10+
end
11+
12+
it 'pymode-syntax options'
13+
Expect g:pymode_syntax == 1
14+
Expect g:pymode_syntax_all == 1
15+
Expect g:pymode_syntax_print_as_function == 0
16+
Expect g:pymode_syntax_highlight_equal_operator == 1
17+
Expect g:pymode_syntax_highlight_stars_operator == 1
18+
Expect g:pymode_syntax_highlight_self == 1
19+
Expect g:pymode_syntax_indent_errors == 1
20+
Expect g:pymode_syntax_space_errors == 1
21+
Expect g:pymode_syntax_string_formatting == 1
22+
Expect g:pymode_syntax_string_format == 1
23+
Expect g:pymode_syntax_string_templates == 1
24+
Expect g:pymode_syntax_doctests == 1
25+
Expect g:pymode_syntax_builtin_objs == 1
26+
Expect g:pymode_syntax_builtin_types == 1
27+
Expect g:pymode_syntax_builtin_funcs == 1
28+
Expect g:pymode_syntax_highlight_exceptions == 1
29+
Expect g:pymode_syntax_slow_sync == 1
30+
end
31+
32+
end
33+

0 commit comments

Comments
 (0)