Example #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
Example #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
Example #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()
Example #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
Example #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()
Example #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
Example #7
0
 def test_good_file(playback: PyK4APlayback):
     playback.open()
     assert playback.calibration
Example #8
0
 def test_bad_file(playback_bad: PyK4APlayback):
     playback_bad.open()
     with pytest.raises(K4AException):
         assert playback_bad.calibration_raw
Example #9
0
 def test_good_file(playback: PyK4APlayback):
     playback.open()
     assert playback.length == 1234
Example #10
0
 def test_double_open(playback: PyK4APlayback):
     playback.open()
     with pytest.raises(K4AException, match=r"Playback already opened"):
         playback.open()
Example #11
0
 def test_seek_eof(playback: PyK4APlayback):
     playback.open()
     with pytest.raises(EOFError):
         playback.seek(9999)
Example #12
0
 def test_good_file(playback: PyK4APlayback):
     playback.open()
     playback.seek(10)
Example #13
0
 def test_bad_file(playback_bad: PyK4APlayback):
     playback_bad.open()
     with pytest.raises(K4AException):
         playback_bad.seek(10)
Example #14
0
 def test_readness(playback: PyK4APlayback):
     playback.open()
     calibration = playback.calibration
     assert calibration
Example #15
0
 def test_readness(playback: PyK4APlayback):
     playback.open()
     assert playback.configuration == RECORD_CONFIGURATION
Example #16
0
 def test_correct_value(playback: PyK4APlayback):
     playback.open()
     assert playback.calibration_raw == RECORD_CALIBRATION_JSON
Example #17
0
 def test_correct_value(playback: PyK4APlayback):
     playback.open()
     assert playback.length == RECORD_LENGTH
Example #18
0
def capture(playback: PyK4APlayback) -> PyK4ACapture:
    playback.open()
    return playback.get_next_capture()