| 49 | |
| 50 | |
| 51 | class TestLoadMotFrameImage: |
| 52 | def test_loads_bgr_array(self, tmp_path: Path) -> None: |
| 53 | image_path = tmp_path / "00000001.jpg" |
| 54 | cv2.imwrite(str(image_path), np.zeros((8, 8, 3), dtype=np.uint8)) |
| 55 | |
| 56 | frame = load_mot_frame_image(tmp_path, 1) |
| 57 | |
| 58 | assert frame.shape == (8, 8, 3) |
| 59 | |
| 60 | def test_raises_when_frame_missing(self, tmp_path: Path) -> None: |
| 61 | with pytest.raises(FileNotFoundError, match=r"frame 3"): |
| 62 | load_mot_frame_image(tmp_path, 3) |
| 63 | |
| 64 | def test_raises_when_file_cannot_be_decoded(self, tmp_path: Path) -> None: |
| 65 | bad = tmp_path / "000001.jpg" |
| 66 | bad.write_bytes(b"not-an-image") |
| 67 | |
| 68 | with pytest.raises(OSError, match=r"Failed to decode"): |
| 69 | load_mot_frame_image(tmp_path, 1) |
nothing calls this directly
no outgoing calls
no test coverage detected