Przeglądaj źródła

test: [LoudFE._keep_min] test min duration

main
Rob Hallam 2 miesięcy temu
rodzic
commit
a6bd196e39
1 zmienionych plików z 13 dodań i 0 usunięć
  1. +13
    -0
      test/test_feature_extractors.py

+ 13
- 0
test/test_feature_extractors.py Wyświetl plik

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


Ładowanie…
Anuluj
Zapisz