diff --git a/test/test_feature_extractors_functional.py b/test/test_feature_extractors_functional.py index 706b509..bd565b8 100644 --- a/test/test_feature_extractors_functional.py +++ b/test/test_feature_extractors_functional.py @@ -86,6 +86,28 @@ class TestLoudAudioFEFunctional(FEFunctionalTest): # check if the highest scoring feature is within the peak range self.assertTrue(sorted_features[0].interval.start >= PEAK_START) + def test_audio_loudness_functional_no_features(self): + """Test audio loudness feature extractor using a silent video. This should produce no features + since "-inf" results from pyloudnorm are filtered out by the FE. + + Use: + - sample_videos/sample-manual-audio-blank-video-colours.mp4 + :: silent video (30s) + -- pass if no features extracted + """ + SAMPLE_VIDEO = f"{self.SAMPLE_DIR}/sample-manual-audio-blank-video-colours.mp4" + + # create mock source with the video + source = mocks.MockSource(path=SAMPLE_VIDEO) + + # create the feature extractor + testfe = extractors.LoudAudioFeatureExtractor(input_files=[source]) + testfe.setup() + testfe.run() + testfe.teardown() + + # check if the feature was extracted: + self.assertFalse(testfe.features) if __name__ == "__main__":