Example #1
0
def test_func_source_builtin_human(fn):
    exp = "Evaluate the given source in the context of globals and locals."
    got = base.func_source(fn, human=1)
    assert got == exp
Example #2
0
def test_func_source_method(fn):
    exp = "def foo(self):\n        pass"
    assert base.func_source(fn, human=1).strip() == exp
Example #3
0
def test_func_source_builtin_id(fn):
    exp = str(eval)
    got = base.func_source(fn, human=0)
    assert got == exp
Example #4
0
def test_func_source_func(fn):
    exp = "def _foo():\n    pass"
    assert base.func_source(fn, human=1).strip() == exp