From 4eaddf9db27c69485772677175b1a61511d47559 Mon Sep 17 00:00:00 2001 From: Rob Hallam <0504004h@student.gla.ac.uk> Date: Sat, 17 Aug 2024 19:39:15 +0100 Subject: [PATCH] test: add TestVAFE --- test/test_feature_extractors.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/test_feature_extractors.py b/test/test_feature_extractors.py index bff0f14..4a4f0ce 100644 --- a/test/test_feature_extractors.py +++ b/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() +