1
0
forked from VimPlug/jedi

moved api, parser and evaluate test directories to test_api, test_parser...

This commit is contained in:
Dave Halter
2014-01-29 21:16:18 +01:00
parent 021aae365d
commit 8660555d7b
31 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
from jedi.parser import Parser
def test_get_code():
"""Use the same code that the parser also generates, to compare"""
s = \
'''"""a docstring"""
class SomeClass(object, mixin):
def __init__(self):
self.xy = 3.0
"""statement docstr"""
def some_method(self):
return 1
def yield_method(self):
while hasattr(self, 'xy'):
yield True
for x in [1, 2]:
yield x
def empty(self):
pass
class Empty:
pass
class WithDocstring:
"""class docstr"""
pass
def method_with_docstring():
"""class docstr"""
pass
'''
assert Parser(s).module.get_code() == s