From d72b9ea2a43f8914b416a78b631464d4e448a807 Mon Sep 17 00:00:00 2001 From: Rob Hallam <0504004h@student.gla.ac.uk> Date: Mon, 16 Sep 2024 00:41:18 +0100 Subject: [PATCH] test: [VizProd] simple colour test --- test/test_producers.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test_producers.py b/test/test_producers.py index d0af2cf..a9c4ead 100644 --- a/test/test_producers.py +++ b/test/test_producers.py @@ -81,6 +81,21 @@ class TestVisualisationProducer(unittest.TestCase): # TODO: more more granular test coverage of produce behaviour + def test_fe_colour(self): + """test that colour picker returns the right colours# + + laughter=red, loudness=blue, video activity=green, words=yellow + """ + # this is a pretty poor test really + expected = {"laughter": "red", "loudness": "blue", "videoactivity": "green", "words": "purple"} + feature = mocks.MockFeature(interval="") + features = [feature] + visprod = producers.VisualisationProducer(features=features) + + for given, expected in expected.items(): + feature.feature_extractor = given + self.assertEqual(visprod._fe_colour(feature), expected) + class TestJSONProducer(unittest.TestCase): def test_init_empty(self): # test with no features -- should raise ValueError