def pytestcase_seek_time_with_negative_time(dataset_dir): """Tests seeking in a file at a position with negative time""" filename = os.path.join(dataset_dir, "metavision_core", "event_io", "recording_td.dat") record = EventDatReader(filename) record.seek_time(-15) assert record.current_event_index() == 0 assert record.done is False assert record.current_time == 0
def pytestcase_seek_time_with_numerous_events(dataset_dir): """Tests seeking in a file containing not so many events at a position defined by a timestamp.The fact that there are numerous events implies that position should be found using dichotomy plus numpy searchsort""" filename = os.path.join(dataset_dir, "metavision_core", "event_io", "recording_td.dat") record = EventDatReader(filename) record.seek_time(100) assert record.current_event_index() == 14 assert record.done is False assert record.current_time == 100