def test_failure_audio_gap_df(self): my_data = [ (1000., pa.Table.from_pydict({"microphone": [10, 20, 30, 40]})), (1500., pa.Table.from_pydict({"microphone": [40, 30, 20, 10]})) ] result = gpu.fill_audio_gaps(my_data, self.sample_interval) error = result.errors.get() self.assertEqual(len(error), 1)
def test_misshapen_audio_gap_df(self): my_data = [ (1000., pa.Table.from_pydict({"microphone": [10, 20, 30, 40]})), (2000., pa.Table.from_pydict({"microphone": [40, 30, 20, 10]})), (5000., pa.Table.from_pydict({"microphone": [5, 15, 25, 35]})) ] result = gpu.fill_audio_gaps(my_data, self.sample_interval) filled_df = result.result gaps = result.gaps self.assertEqual(len(filled_df["timestamps"]), 20) self.assertEqual(len(gaps), 1)