Test `reset()` functions as expected.
(self, vs_type: ty.Callable[..., VideoStream], test_video: VideoParameters)
| 196 | ) |
| 197 | |
| 198 | def test_reset(self, vs_type: ty.Callable[..., VideoStream], test_video: VideoParameters): |
| 199 | """Test `reset()` functions as expected.""" |
| 200 | stream = vs_type(test_video.path) |
| 201 | # Decode some frames, then reset the VideoStream and validate the time invariants. |
| 202 | for _ in range(10): |
| 203 | stream.read() |
| 204 | assert stream.frame_number == 10 |
| 205 | stream.reset() |
| 206 | assert stream.frame_number == 0 |
| 207 | assert stream.position == 0 |
| 208 | assert stream.position_ms == pytest.approx(0, abs=TIME_TOLERANCE_MS) |
| 209 | |
| 210 | def test_seek(self, vs_type: ty.Callable[..., VideoStream], test_video: VideoParameters): |
| 211 | """Validate `seek()` functionality with different offset types.""" |