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