This commit is contained in:
Grant Lanham Jr
2025-02-09 15:06:46 +01:00
committed by GitHub
4 changed files with 39 additions and 25 deletions
+11 -4
View File
@@ -39,12 +39,19 @@ class TestQuery(SearxTestCase):
r = repr(query)
self.assertTrue(r.startswith(f"<RawTextQuery query='{query_text}' "))
def test_change_query(self):
def test_get_new_full_query(self):
query_text = '<8 the query'
query = RawTextQuery(query_text, [])
another_query = query.changeQuery('another text')
self.assertEqual(query, another_query)
self.assertEqual(query.getFullQuery(), '<8 another text')
full_query = query.getFullQuery()
new_full_query = query.getNewFullQuery('another text')
self.assertNotEqual(full_query, new_full_query)
def test_get_new_full_query_trim(self):
query_text = 'foo bar'
query = RawTextQuery(query_text, [])
new_query = 'bizz bazz'
new_full_query = query.getNewFullQuery(" " + new_query + " ")
self.assertEqual(new_query, new_full_query)
class TestLanguageParser(SearxTestCase):