Ver código fonte

test: add negative test to TestLoudAudioFEFunctional

Video file with silent audio (generated with sox) -- should produce no features
since "-inf" are filtered by the FE
main
Rob Hallam 1 mês atrás
pai
commit
8a5916192a
1 arquivos alterados com 22 adições e 0 exclusões
  1. +22
    -0
      test/test_feature_extractors_functional.py

+ 22
- 0
test/test_feature_extractors_functional.py Ver arquivo

@@ -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__":


Carregando…
Cancelar
Salvar