| 1 | """Tests for Threads source module.""" |
| 2 | |
| 3 | import unittest |
| 4 | |
| 5 | from lib import threads |
| 6 | |
| 7 | |
| 8 | class TestExtractCoreSubject(unittest.TestCase): |
| 9 | """Test Threads query preprocessing.""" |
| 10 | |
| 11 | def test_caps_verbose_planner_query_to_two_words(self): |
| 12 | self.assertEqual( |
| 13 | threads._extract_core_subject("AI video tools OR tutorials"), |
| 14 | "ai video", |
| 15 | ) |
| 16 | |
| 17 | def test_caps_all_noise_fallback_to_two_words(self): |
| 18 | self.assertEqual( |
| 19 | threads._extract_core_subject("best practices and recommendations"), |
| 20 | "best practices", |
| 21 | ) |
| 22 | |
| 23 | |
| 24 | if __name__ == "__main__": |
| 25 | unittest.main() |
| 26 |