Method
test_simple
(self, tmpfile: BinaryIO)
Source from the content-addressed store, hash-verified
| 1034 | |
| 1035 | class TestFDCapture: |
| 1036 | def test_simple(self, tmpfile: BinaryIO) -> None: |
| 1037 | fd = tmpfile.fileno() |
| 1038 | cap = capture.FDCapture(fd) |
| 1039 | data = b"hello" |
| 1040 | os.write(fd, data) |
| 1041 | with pytest.raises(AssertionError): |
| 1042 | cap.snap() |
| 1043 | cap.done() |
| 1044 | cap = capture.FDCapture(fd) |
| 1045 | cap.start() |
| 1046 | os.write(fd, data) |
| 1047 | s = cap.snap() |
| 1048 | cap.done() |
| 1049 | assert s == "hello" |
| 1050 | |
| 1051 | def test_simple_many(self, tmpfile: BinaryIO) -> None: |
| 1052 | for i in range(10): |
Tested by
no test coverage detected