24 lines
717 B
Python
24 lines
717 B
Python
import unittest
|
|
|
|
from src.lyricflow_core.api.analysis import analysis_service
|
|
|
|
|
|
class TestLyricAnalysisService(unittest.TestCase):
|
|
def test_similarity_available(self):
|
|
score = analysis_service.similarity("cat", "mat")
|
|
self.assertGreaterEqual(score, 0.5)
|
|
|
|
def test_lmd_syntax_filtered_in_density(self):
|
|
text = "# Header\n[Voice: The Jester]\ncat bat"
|
|
densities = analysis_service.line_densities(text)
|
|
self.assertEqual([0.0, 0.0, 1.0], densities)
|
|
|
|
def test_suggestions_shape(self):
|
|
results = analysis_service.suggestions("cat")
|
|
self.assertIn("perfect", results)
|
|
self.assertIn("slant", results)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|