33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | |
def test_writeorg(self): |
tmppath = py.test.ensuretemp('test_writeorg').ensure('stderr', |
file=True) |
tmpfp = tmppath.open('w+b') |
try: |
cap = py.io.FDCapture(tmpfp.fileno()) |
print >>tmpfp, 'foo' |
-> cap.writeorg('bar\n') |
finally: |
tmpfp.close() |
f = cap.done() |
scap = f.read() |
assert scap == 'foo\n' |
stmp = tmppath.read() |
assert stmp == "bar\n" | |