Exemple #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
Exemple #2
0
def test_func_source_method(fn):
    exp = "def foo(self):\n        pass"
    assert base.func_source(fn, human=1).strip() == exp
Exemple #3
0
def test_func_source_builtin_id(fn):
    exp = str(eval)
    got = base.func_source(fn, human=0)
    assert got == exp
Exemple #4
0
def test_func_source_func(fn):
    exp = "def _foo():\n    pass"
    assert base.func_source(fn, human=1).strip() == exp