-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom template tests and fix some bugs
There 2 issues have been addressed: - If the given g:pydocstring_templates_dir is not ended with a slash '/', auto append it. - Reduce the need for one local variable (s:tmpldir) since we always have to use one variable to store template dir.
- Loading branch information
Le Tien Tai
committed
Nov 18, 2016
1 parent
ed6a468
commit 01ebb67
Showing
2 changed files
with
65 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,56 @@ | ||
Do (Test 2): | ||
iThis is the second test file. | ||
# vim:set et sw=4 ts=4 tw=79: | ||
Execute (Setup template dir): | ||
Save g:pydocstring_templates_dir | ||
let g:pydocstring_templates_dir = './test-template/' | ||
|
||
Expect (Test 2): | ||
This is the second test file. | ||
Given python (def foo): | ||
def foo(): | ||
pass | ||
|
||
Execute: | ||
Pydocstring | ||
|
||
|
||
Expect python: | ||
def foo(): | ||
"""foo is """ | ||
pass | ||
|
||
|
||
Given python (def foo with 1 params): | ||
def foo(arg1): | ||
pass | ||
|
||
Execute: | ||
Pydocstring | ||
|
||
Expect python: | ||
def foo(arg1): | ||
"""foo | ||
|
||
arg1: | ||
arg1 is | ||
""" | ||
pass | ||
|
||
|
||
Given python (def foo with 2 params): | ||
def foo(arg1, arg2): | ||
pass | ||
|
||
Execute: | ||
Pydocstring | ||
|
||
Expect python: | ||
def foo(arg1, arg2): | ||
"""foo | ||
|
||
arg1: | ||
arg1 is | ||
arg2: | ||
arg2 is | ||
""" | ||
pass | ||
|
||
Execute (Clear pydocstring_templates_dir): | ||
Restore |