def test_identify_commercials_returns_none(self): audio_data = audio_volume_data_no_commercial.DATA commercial_intervals = editor.guess_commercial_intervals(audio_data) self.assert_length(commercial_intervals, 0) non_commercials = editor.invert_intervals(commercial_intervals, len(audio_data)) self.assertEqual(non_commercials, [(0, len(audio_data) - 1)])
def test_identify_commercials(self): audio_data = audio_volume_data.DATA commercial_intervals = editor.guess_commercial_intervals(audio_data) self.assert_length(commercial_intervals, 4) non_commercials = editor.invert_intervals(commercial_intervals, len(audio_data)) self.assert_length(non_commercials, 5)