def run_tests(): # type: () -> None stdout = mylib.Stdout() out = TextOutput(stdout) out.write('foo\n') out.write('bar\n') log('Wrote %d bytes', out.num_chars) #b = Base() d = Derived() #log(b.method()) log(d.method()) log(f(d))
def run_tests(): # type: () -> None f = mylib.BufWriter() for i in xrange(30): f.write(chr(i + 65)) contents = f.getvalue() log('Wrote %d bytes to StringIO', len(contents)) log('contents = %s ... %s', contents[:10], contents[-10:]) f2 = mylib.Stdout() f2.write('stdout\n')