Skip to content

Commit fc8735f

Browse files
authored
Add tests (#33)
* Solved exception: Template does not exist For some reason, I added set wildignore=*.txt in my vimrc, which caused expand('/path/to/file.txt') failure, so only expand tmpldir instead of full path. * Add template does not found exception tests
1 parent b7aeb69 commit fc8735f

File tree

5 files changed

+53
-3
lines changed

5 files changed

+53
-3
lines changed

CHANGES.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
Version 0.1.4
2+
-------------
3+
Released on Sep 10th 2017
4+
5+
- Fix bug
6+
7+
Template does not exist exception at set wildignore=*.txt
8+
9+
see https://github.com/heavenshell/vim-pydocstring/pull/32
10+
11+
Thx @demonye
12+
113
Version 0.1.3
214
-------------
315
Released on Jul 18th 2017

autoload/pydocstring.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Insert Docstring.
22
" Author: Shinya Ohyanagi <[email protected]>
3-
" Version: 0.1.3
3+
" Version: 0.1.4
44
" WebPage: http://github.com/heavenshell/vim-pydocstriong/
55
" Description: Generate Python docstring to your Python script file.
66
" License: BSD, see LICENSE for more details.

doc/pydocstring.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*pydocstring.txt* Generate Python docstring to your Python code.
22

3-
Version: 0.1.3
3+
Version: 0.1.4
44
Author: Shinya Ohynagi <[email protected]>
55
Repository: http://github.com/heavenshell/vim-pydocstring/
66
License: BSD, see LICENSE for more details.

ftplugin/python/pydocstring.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" File: pydocstring.vim
22
" Author: Shinya Ohyanagi <[email protected]>
3-
" Version: 0.1.3
3+
" Version: 0.1.4
44
" WebPage: http://github.com/heavenshell/vim-pydocstriong/
55
" Description: Generate Python docstring to your Python script file.
66
" License: BSD, see LICENSE for more details.

test/issue_wildignore.vader

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# vim:set et sw=4 ts=4 tw=79:
2+
# Execute (Setup template dir):
3+
# set wildignore=*.txt
4+
5+
Given python (template_dir does not exists):
6+
def foo(arg1):
7+
pass
8+
9+
Execute:
10+
let templates_dir = g:pydocstring_templates_dir
11+
Save g:pydocstring_templates_dir
12+
let g:pydocstring_templates_dir = './notfound/'
13+
:redir => ret
14+
:Pydocstring
15+
:redir END
16+
let g:pydocstring_templates_dir = templates_dir
17+
AssertEqual ret, "\nTemplate ./notfound/multi.txt does not exist."
18+
19+
20+
Expect python:
21+
def foo(arg1):
22+
pass
23+
24+
Given python (set wildignore=*.txt):
25+
def foo(arg1):
26+
pass
27+
28+
Execute:
29+
:set wildignore=*.txt
30+
:Pydocstring
31+
32+
Expect python:
33+
def foo(arg1):
34+
"""foo
35+
36+
:param arg1:
37+
"""
38+
pass

0 commit comments

Comments
 (0)