You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
715 B

import unittest
from simple_danmu_analyzer import SimpleDanmuAnalyzer
class TestSimpleDanmuAnalyzer(unittest.TestCase):
def setUp(self):
self.analyzer = SimpleDanmuAnalyzer()
self.analyzer.danmu_list = [
'大语言模型很强大',
'AI改变世界',
'机器学习很有趣',
'大语言模型应用',
'深度学习技术'
]
def test_analyze_words(self):
result = self.analyzer.analyze_words(3)
self.assertEqual(len(result), 3)
def test_get_conclusions(self):
result = self.analyzer.get_conclusions()
self.assertIn("共分析", result)
if __name__ == '__main__':
unittest.main()