-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtest_helpers_docstring.py
More file actions
65 lines (49 loc) · 1.35 KB
/
test_helpers_docstring.py
File metadata and controls
65 lines (49 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# -*- coding: UTF-8 -*-
"""Dictionary assets' tests.
"""
from tinyscript.helpers.docstring import *
from utils import *
class _Example1(object):
pass
class _Example2(object):
"""
This is a test multi-line long
description.
This is a first comment.
Author: John Doe
(john.doe@example.com)
Version: 1.0
Comments:
- subcomment 1
- subcomment 2
Options:
- test | str
- test2 | int
Something: lorem ipsum
paragraph
This is a second comment,
a multi-line one.
Options: test3 | list
"""
pass
_info = {
'author': "John Doe (john.doe@example.com)",
'comments': [
"This is a first comment.",
("subcomment 1", "subcomment 2"),
"This is a second comment, a multi-line one.",
],
'description': "This is a test multi-line long description.",
'options': [
('test', 'str'),
('test2', 'int'),
('test3', 'list'),
],
'something': "lorem ipsum paragraph",
'version': "1.0",
}
class TestHelpersDocstring(TestCase):
def test_parse_docstring(self):
self.assertEqual(parse_docstring(_Example1), {})
self.assertEqual(parse_docstring(_Example2.__doc__), _info)
self.assertEqual(parse_docstring(_Example2), _info)