From a6bd196e3922663e55e562ebc80c4806647a37bb Mon Sep 17 00:00:00 2001 From: Rob Hallam <0504004h@student.gla.ac.uk> Date: Mon, 16 Sep 2024 00:44:44 +0100 Subject: [PATCH] test: [LoudFE._keep_min] test min duration --- test/test_feature_extractors.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/test_feature_extractors.py b/test/test_feature_extractors.py index fceed31..ab34005 100644 --- a/test/test_feature_extractors.py +++ b/test/test_feature_extractors.py @@ -252,6 +252,19 @@ class TestLoudAudioFeatureExtractor(unittest.TestCase): test_extractor.teardown() self.assertEqual(len(test_extractor.features), 10) + # test with min_duration + min_duration = 100 + with self.subTest("min_duration"): + test_extractor = extractors.LoudAudioFeatureExtractor(input_files=video_source, + min_duration=min_duration, + num_features=10) + test_extractor._get_loudnesses = self._mock_get_loudnessess + test_extractor.setup() + test_extractor.run() + test_extractor.teardown() + for feature in test_extractor.features: + self.assertGreaterEqual(feature.interval.duration, min_duration) + # TODO: add sample video with loud audio to test _loudnessdetect() class TestVideoActivityFeatureExtractor(unittest.TestCase):