소스 검색

test: add TestVAFE

main
Rob Hallam 3 달 전
부모
커밋
4eaddf9db2
1개의 변경된 파일24개의 추가작업 그리고 0개의 파일을 삭제
  1. +24
    -0
      test/test_feature_extractors.py

+ 24
- 0
test/test_feature_extractors.py 파일 보기

@@ -81,3 +81,27 @@ class TestLoudAudioFeatureExtractor(unittest.TestCase):
test_extractor.teardown()
self.assertEqual(test_extractor.features, [])

class TestVideoActivityFeatureExtractor(unittest.TestCase):
"""Test VideoActivityFeatureExtractor"""

def test_init(self):
video_source = TestSourceMedia().one_colour_silent_audio()
test_extractor = extractors.VideoActivityFeatureExtractor(input_files=video_source)
self.assertTrue(test_extractor)

def test_init_noinput(self):
"""test init - no input files"""
with self.assertRaises(ValueError):
test_extractor = extractors.VideoActivityFeatureExtractor()

def test_extract(self):
"""Test extract with basic input file runs with no errors"""
video_source = TestSourceMedia().one_colour_silent_audio()
test_extractor = extractors.VideoActivityFeatureExtractor(input_files=video_source)
test_extractor.setup()
test_extractor.run()
test_extractor.teardown()
self.assertTrue(test_extractor.features)

# TODO: add sample video with activity to test _activitydetect()


불러오는 중...
취소
저장