Commit 23802f87 by Alexander Kryklia Committed by Vasyl Nakvasiuk

add tests for percents and for total percents

parent 116b07df
......@@ -109,9 +109,11 @@ class WordCloudModuleTest(LogicTest):
)
self.assertListEqual(
response['top_words'],
[{'text': 'dad', 'size': 2},
{'text': 'sun', 'size': 1},
{'text': 'dog', 'size': 6},
{'text': 'mom', 'size': 1},
{'text': 'cat', 'size': 12}]
[{'text': 'dad', 'size': 2, 'percent': 9.0},
{'text': 'sun', 'size': 1, 'percent': 5.0},
{'text': 'dog', 'size': 6, 'percent': 27.0},
{'text': 'mom', 'size': 1, 'percent': 5.0},
{'text': 'cat', 'size': 12, 'percent': 54.0}]
)
self.assertEqual(100.0, sum(i['percent'] for i in response['top_words']) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment