Skip to content

Commit dc16f34

Browse files
author
Le Tien Tai
committed
Add test case for Pydocstring with default template
1 parent f4cb9f1 commit dc16f34

File tree

1 file changed

+150
-4
lines changed

1 file changed

+150
-4
lines changed

test/basic.vader

Lines changed: 150 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,151 @@
1-
Do (Sample):
2-
iHello, world!
1+
# vim:set et sw=4 ts=4 tw=79:
2+
3+
# Test def keyword
4+
#-------------------------------------------------------------------------------
5+
Given python (def foo):
6+
def foo():
7+
pass
8+
9+
Execute:
10+
Pydocstring
11+
12+
Expect python:
13+
def foo():
14+
"""foo"""
15+
pass
16+
17+
Given python (def foo with 1 param):
18+
def foo(arg):
19+
pass
20+
21+
Execute:
22+
Pydocstring
23+
24+
Expect python:
25+
def foo(arg):
26+
"""foo
27+
28+
:param arg:
29+
"""
30+
pass
31+
32+
Given python (def foo with 2 params):
33+
def foo(arg1, arg2):
34+
pass
35+
36+
Execute:
37+
Pydocstring
38+
39+
Expect python:
40+
def foo(arg1, arg2):
41+
"""foo
42+
43+
:param arg1:
44+
:param arg2:
45+
"""
46+
pass
47+
48+
Given python (def foo with variadic params):
49+
def foo(*arg):
50+
pass
51+
52+
Execute:
53+
Pydocstring
54+
Expect python:
55+
def foo(*arg):
56+
"""foo
57+
58+
:param *arg:
59+
"""
60+
pass
61+
62+
63+
# Test class keyword
64+
#-------------------------------------------------------------------------------
65+
66+
67+
Given python (class Foo):
68+
class Foo(object):
69+
def foo(self):
70+
pass
71+
72+
def arg1(self, arg1):
73+
pass
74+
75+
Execute:
76+
Pydocstring
77+
78+
Expect python:
79+
class Foo(object):
80+
"""Foo"""
81+
def foo(self):
82+
pass
83+
84+
def arg1(self, arg1):
85+
pass
86+
87+
88+
Given python (class Foo):
89+
class Foo(object):
90+
def foo(self):
91+
pass
92+
93+
def arg1(self, arg1):
94+
pass
95+
96+
Do (Put cursor to def foo(self)):
97+
j
98+
99+
Then Execute (Execute Pydocstring on def foo(self)):
100+
Pydocstring
101+
102+
Expect python:
103+
class Foo(object):
104+
def foo(self):
105+
"""foo"""
106+
pass
107+
108+
def arg1(self, arg1):
109+
pass
110+
111+
112+
Given python (class Foo):
113+
class Foo(object):
114+
def foo(self):
115+
pass
116+
117+
def arg1(self, arg1):
118+
pass
119+
120+
Do (Put cursor to def arg1(self, arg1)):
121+
4j
122+
123+
Then Execute (Execute Pydocstring on def arg1(self, arg1)):
124+
Pydocstring
125+
126+
Expect python:
127+
class Foo(object):
128+
def foo(self):
129+
pass
130+
131+
def arg1(self, arg1):
132+
"""arg1
133+
134+
:param arg1:
135+
"""
136+
pass
137+
138+
# Test aync/await keyword
139+
#-------------------------------------------------------------------------------
140+
Given python (async def foo):
141+
async def foo():
142+
pass
143+
144+
Execute:
145+
Pydocstring
146+
147+
Expect python:
148+
async def foo():
149+
"""foo"""
150+
pass
3151

4-
Expect(Sample):
5-
Hello, world!

0 commit comments

Comments
 (0)