Browse Source

test: [VizProd] simple colour test

main
Rob Hallam 2 months ago
parent
commit
d72b9ea2a4
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      test/test_producers.py

+ 15
- 0
test/test_producers.py View File

@@ -81,6 +81,21 @@ class TestVisualisationProducer(unittest.TestCase):


# TODO: more more granular test coverage of produce behaviour # 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): class TestJSONProducer(unittest.TestCase):
def test_init_empty(self): def test_init_empty(self):
# test with no features -- should raise ValueError # test with no features -- should raise ValueError


Loading…
Cancel
Save