| 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): |