|
|
@@ -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): |
|
|
|