326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 | |
def test_function_source(self): |
def blah(): |
a = 3 |
b = 4 |
return a + b |
|
descs = {'blah': blah} |
ds = DocStorage().from_dict(descs) |
t = Tracer(ds) |
-> t.start_tracing() |
blah() |
t.end_tracing() |
lg = DirectPaste() |
tempdir = temppath.ensure("function_source", dir=True) |
r = RestGen(DocStorageAccessor(ds), lg, DirWriter(tempdir)) |
r.write() |
assert tempdir.join("function_blah.txt").read().find("a = 3") != -1 |
self.check_rest(tempdir) |
ps = DocStorageAccessor(ds) |
r = RestGen(ps, lg, DirWriter(tempdir)) |
r.write() |
assert tempdir.join("function_blah.txt").read().find("a = 3") != -1 | |