diff --git a/test/test_feature_extractors.py b/test/test_feature_extractors.py index 1e2b743..1689f99 100644 --- a/test/test_feature_extractors.py +++ b/test/test_feature_extractors.py @@ -13,6 +13,12 @@ class TestSource(): SAMPLE_VIDEO = f"{TEST_DIR}/sample_videos/test_video_red_silentaudio.mp4" # silent video definitely has no laughter return Source(source=SAMPLE_VIDEO, path=SAMPLE_VIDEO, provider="test") +class TestSourceMedia(): + """Provide utils.SourceMedia for testing""" + def one_colour_silent_audio(self): + """Provide a source with a silent mono-colour video""" + return SourceMedia(sources=[TestSource().one_colour_silent_audio()]) + class TestLaughterFeatureExtractor(unittest.TestCase): """Test LaughterFeatureExtractor""" def test_init(self): @@ -39,6 +45,12 @@ class TestRandomFeatureExtractor(unittest.TestCase): test_extractor.setup() # NB test WITH sources implicitly tested in test_extract + def test_extract_noinput(self): + """Test extract with no input files""" + test_extractor = extractors.RandomFeatureExtractor() + with self.assertRaises(ValueError): + test_extractor.run() + def test_extract(self): """Test extract with input files""" video_source = TestSourceMedia().one_colour_silent_audio()