14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | |
def test_repr_source(): |
source = py.code.Source(""" |
def f(x): |
pass |
-> """).strip() |
config = newconfig() |
s = StringIO() |
out = getout(s) |
p = Presenter(out, config) |
p.repr_source(source, "|", 0) |
lines = s.getvalue().split("\n") |
assert len(lines) == 3 |
assert lines[0].startswith("|") |
assert lines[0].find("def f(x)") != -1 |
assert lines[1].find("pass") != -1 | |