Method
test_simple
(self, tmpfile: BinaryIO)
Source from the content-addressed store, hash-verified
| 955 | |
| 956 | class TestFDCapture: |
| 957 | def test_simple(self, tmpfile: BinaryIO) -> None: |
| 958 | fd = tmpfile.fileno() |
| 959 | cap = capture.FDCapture(fd) |
| 960 | data = b"hello" |
| 961 | os.write(fd, data) |
| 962 | pytest.raises(AssertionError, cap.snap) |
| 963 | cap.done() |
| 964 | cap = capture.FDCapture(fd) |
| 965 | cap.start() |
| 966 | os.write(fd, data) |
| 967 | s = cap.snap() |
| 968 | cap.done() |
| 969 | assert s == "hello" |
| 970 | |
| 971 | def test_simple_many(self, tmpfile: BinaryIO) -> None: |
| 972 | for i in range(10): |
Tested by
no test coverage detected