Exemplo n.º 1
0
 def test_seek_by_device_time(playback: PyK4APlayback):
     # TODO fetch capture/data and validate time
     playback.open()
     playback.seek(1, origin=SeekOrigin.DEVICE_TIME
                   )  # TODO add correct timestamp from datablock here
     capture = playback.get_next_capture()
     assert capture.color is not None
Exemplo n.º 2
0
 def test_get_next_capture(playback: PyK4APlayback):
     playback.open()
     capture = playback.get_next_capture()
     assert capture is not None
     assert capture.depth is not None
     assert capture.color is not None
     assert capture._calibration is not None  # Issue #81
Exemplo n.º 3
0
 def test_seek_from_end(playback: PyK4APlayback):
     # TODO fetch capture/data and validate time
     playback.open()
     playback.seek(0, origin=SeekOrigin.END)
     capture = playback.get_previouse_capture()
     assert capture.color is not None
     with pytest.raises(EOFError):
         playback.get_next_capture()
Exemplo n.º 4
0
 def test_get_previouse_capture(playback: PyK4APlayback):
     playback.open()
     playback.seek(0, origin=SeekOrigin.END)
     capture = playback.get_previouse_capture()
     assert capture is not None
     assert capture.depth is not None
     assert capture.color is not None
     assert capture._calibration is not None  # Issue #81
Exemplo n.º 5
0
 def test_seek_from_start(playback: PyK4APlayback):
     # TODO fetch capture/data and validate time
     playback.open()
     playback.get_next_capture()
     playback.seek(playback.configuration["start_timestamp_offset_usec"], origin=SeekOrigin.BEGIN)
     capture = playback.get_next_capture()
     assert capture.color is not None
     with pytest.raises(EOFError):
         playback.get_previouse_capture()
Exemplo n.º 6
0
 def test_get_next_capture(playback: PyK4APlayback):
     playback.open()
     capture = playback.get_next_capture()
     assert capture is not None
     assert capture.depth is not None
     assert capture.color is not None
     assert capture.depth_timestamp_usec == 800222
     assert capture.color_timestamp_usec == 800222
     assert capture.ir_timestamp_usec == 800222
     assert capture._calibration is not None  # Issue #81
Exemplo n.º 7
0
 def test_good_file(playback: PyK4APlayback):
     playback.open()
     assert playback.calibration
Exemplo n.º 8
0
 def test_bad_file(playback_bad: PyK4APlayback):
     playback_bad.open()
     with pytest.raises(K4AException):
         assert playback_bad.calibration_raw
Exemplo n.º 9
0
 def test_good_file(playback: PyK4APlayback):
     playback.open()
     assert playback.length == 1234
Exemplo n.º 10
0
 def test_double_open(playback: PyK4APlayback):
     playback.open()
     with pytest.raises(K4AException, match=r"Playback already opened"):
         playback.open()
Exemplo n.º 11
0
 def test_seek_eof(playback: PyK4APlayback):
     playback.open()
     with pytest.raises(EOFError):
         playback.seek(9999)
Exemplo n.º 12
0
 def test_good_file(playback: PyK4APlayback):
     playback.open()
     playback.seek(10)
Exemplo n.º 13
0
 def test_bad_file(playback_bad: PyK4APlayback):
     playback_bad.open()
     with pytest.raises(K4AException):
         playback_bad.seek(10)
Exemplo n.º 14
0
 def test_readness(playback: PyK4APlayback):
     playback.open()
     calibration = playback.calibration
     assert calibration
Exemplo n.º 15
0
 def test_readness(playback: PyK4APlayback):
     playback.open()
     assert playback.configuration == RECORD_CONFIGURATION
Exemplo n.º 16
0
 def test_correct_value(playback: PyK4APlayback):
     playback.open()
     assert playback.calibration_raw == RECORD_CALIBRATION_JSON
Exemplo n.º 17
0
 def test_correct_value(playback: PyK4APlayback):
     playback.open()
     assert playback.length == RECORD_LENGTH
Exemplo n.º 18
0
def capture(playback: PyK4APlayback) -> PyK4ACapture:
    playback.open()
    return playback.get_next_capture()