|
@@ -13,6 +13,12 @@ class TestSource(): |
|
|
SAMPLE_VIDEO = f"{TEST_DIR}/sample_videos/test_video_red_silentaudio.mp4" # silent video definitely has no laughter |
|
|
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") |
|
|
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): |
|
|
class TestLaughterFeatureExtractor(unittest.TestCase): |
|
|
"""Test LaughterFeatureExtractor""" |
|
|
"""Test LaughterFeatureExtractor""" |
|
|
def test_init(self): |
|
|
def test_init(self): |
|
@@ -39,6 +45,12 @@ class TestRandomFeatureExtractor(unittest.TestCase): |
|
|
test_extractor.setup() |
|
|
test_extractor.setup() |
|
|
# NB test WITH sources implicitly tested in test_extract |
|
|
# 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): |
|
|
def test_extract(self): |
|
|
"""Test extract with input files""" |
|
|
"""Test extract with input files""" |
|
|
video_source = TestSourceMedia().one_colour_silent_audio() |
|
|
video_source = TestSourceMedia().one_colour_silent_audio() |
|
|