diff --git a/test/test_feature_extractors_functional.py b/test/test_feature_extractors_functional.py index 7da5cff..cbccede 100644 --- a/test/test_feature_extractors_functional.py +++ b/test/test_feature_extractors_functional.py @@ -254,5 +254,29 @@ class TestWordFEFunctional(FEFunctionalTest): with self.assertRaises(RuntimeError): testfe.run() + def test_audio_word_detection_harvard_no_matching_words(self): + """Test audio word detection feature extractor + Uses: + - sample-manual-audio-harvardsentences-video-colours.mp4 + :: Harvard sentences (list 1) up to item 1.8 ("The birch canoe... The hogs were fed") + plus the sentence: "Portez ce vieux whisky au juge blond qui fume" + -- pass if no features extracted + """ + + SAMPLE_VIDEO = f"{self.SAMPLE_DIR}/sample-manual-audio-harvardsentences-video-colours.mp4" + DETECT_WORDS = "Portez ce vieux whisky au juge blond qui fume".split() + + # create mock source with the video + source = mocks.MockSource(path=SAMPLE_VIDEO) + + # create the feature extractor + testfe = extractors.WordFeatureExtractor(input_files=[source]) + testfe.setup(words=DETECT_WORDS) + testfe.run() + testfe.teardown() + + # ensure no Features: + self.assertEqual(len(testfe.features), 0) + if __name__ == "__main__": unittest.main()