Changeset 33 for branches/mk/tests/test_code_parser.py
- Timestamp:
- 05/31/06 17:32:14 (6 years ago)
- Files:
-
- branches/mk/tests/test_code_parser.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mk/tests/test_code_parser.py
r32 r33 2 2 3 3 import _path_cheesecake 4 from _helper_cheesecake import set 5 4 6 from cheesecake.codeparser import CodeParser 5 7 … … 22 24 "module1.Class1.method2", 23 25 "module1.Class1.method3", 24 "module1.Class1.method4"] 26 "module1.Class1.method4", 27 "module1.Class1.method5",] 25 28 26 29 def test_functions(self): … … 31 34 "module1.func4", 32 35 "module1.__func5__", 33 "module1.func6"] 36 "module1.func6", 37 "module1.func7"] 34 38 35 39 def test_count(self): 36 assert self.code1.object_count() == 15 37 assert self.code1.docstring_count() == 12 40 assert self.code1.object_count() == 17 41 assert self.code1.docstring_count() == 14 42 assert self.code1.rest_docstring_count() == 2 38 43 39 44 def test_docstrings(self): … … 47 52 "module1.Class1.method2", 48 53 "module1.Class1.method3", 54 "module1.Class1.method5", 49 55 "module1.func1", 50 56 "module1.func2", 51 57 "module1.func3", 52 58 "module1.__func5__", 59 "module1.func7", 53 60 ] 54 61 55 objects_without_docstrings = [ 56 "module1.Class1.method4", 57 "module1.func4", 58 "module1.func6", 62 objects_with_rest_docstrings = [ 63 "module1.Class1.method5", 64 "module1.func7", 59 65 ] 60 66 61 67 print self.code1.docstrings 62 68 63 for obj in objects_with_docstrings: 64 assert self.code1.docstrings.get(obj) == 1 65 66 for obj in objects_without_docstrings: 67 assert not self.code1.docstrings.get(obj) 69 assert set(objects_with_docstrings) == set(self.code1.docstrings) 70 assert set(objects_with_rest_docstrings) == set(self.code1.rest_docstrings)
