MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_writeorg

Method test_writeorg

testing/test_capture.py:1001–1013  ·  view source on GitHub ↗
(self, tmpfile: BinaryIO)

Source from the content-addressed store, hash-verified

999 assert x == b""
1000
1001 def test_writeorg(self, tmpfile: BinaryIO) -> None:
1002 data1, data2 = b"foo", b"bar"
1003 cap = capture.FDCapture(tmpfile.fileno())
1004 cap.start()
1005 tmpfile.write(data1)
1006 tmpfile.flush()
1007 cap.writeorg(data2.decode("ascii"))
1008 scap = cap.snap()
1009 cap.done()
1010 assert scap == data1.decode("ascii")
1011 with open(tmpfile.name, "rb") as stmp_file:
1012 stmp = stmp_file.read()
1013 assert stmp == data2
1014
1015 def test_simple_resume_suspend(self) -> None:
1016 with saved_fd(1):

Callers

nothing calls this directly

Calls 8

writeorgMethod · 0.95
snapMethod · 0.95
filenoMethod · 0.45
startMethod · 0.45
writeMethod · 0.45
flushMethod · 0.45
doneMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected