[svn r60139] some minimal testing for Code.source/fullsource
--HG-- branch : trunk
This commit is contained in:
parent
d491d68d51
commit
3ec0a76adb
|
@ -83,3 +83,19 @@ def test_code_with_class():
|
|||
class A:
|
||||
pass
|
||||
py.test.raises(TypeError, "py.code.Code(A)")
|
||||
|
||||
if True:
|
||||
def x():
|
||||
pass
|
||||
|
||||
def test_code_fullsource():
|
||||
code = py.code.Code(x)
|
||||
full = code.fullsource
|
||||
assert 'test_code_fullsource()' in str(full)
|
||||
|
||||
def test_code_source():
|
||||
code = py.code.Code(x)
|
||||
src = code.source()
|
||||
expected = """def x():
|
||||
pass"""
|
||||
assert str(src) == expected
|
||||
|
|
Loading…
Reference in New Issue