MCPcopy
hub / github.com/pytest-dev/pytest / test_writeorg

Method test_writeorg

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

Source from the content-addressed store, hash-verified

1080 assert x == b""
1081
1082 def test_writeorg(self, tmpfile: BinaryIO) -> None:
1083 data1, data2 = b"foo", b"bar"
1084 cap = capture.FDCapture(tmpfile.fileno())
1085 cap.start()
1086 tmpfile.write(data1)
1087 tmpfile.flush()
1088 cap.writeorg(data2.decode("ascii"))
1089 scap = cap.snap()
1090 cap.done()
1091 assert scap == data1.decode("ascii")
1092 with open(tmpfile.name, "rb") as stmp_file:
1093 stmp = stmp_file.read()
1094 assert stmp == data2
1095
1096 def test_simple_resume_suspend(self) -> None:
1097 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