示例#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()