MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / test_reset

Method test_reset

tests/test_video_stream.py:198–208  ·  view source on GitHub ↗

Test `reset()` functions as expected.

(self, vs_type: ty.Callable[..., VideoStream], test_video: VideoParameters)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected