summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2020-10-26 13:33:40 +0100
committerAdam Tauber <asciimoo@gmail.com>2020-10-26 14:15:59 +0100
commit2aef38c3b9d1fe93e9d665a49b10151d63d92392 (patch)
tree3e56ec69f2e2f56ff09d4831b4634c4e7ef19ca2 /tests
parent0a44fa8bb7eca0d81f0ebdab37b9845b260473ad (diff)
downloadsearxng-2aef38c3b9d1fe93e9d665a49b10151d63d92392.tar.gz
searxng-2aef38c3b9d1fe93e9d665a49b10151d63d92392.zip
[fix] resolve query_parts regression
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_query.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/unit/test_query.py b/tests/unit/test_query.py
index d682876c0..eff4d643c 100644
--- a/tests/unit/test_query.py
+++ b/tests/unit/test_query.py
@@ -9,7 +9,8 @@ class TestQuery(SearxTestCase):
query = RawTextQuery(query_text, [])
self.assertEqual(query.getFullQuery(), query_text)
- self.assertEqual(len(query.query_parts), 3)
+ self.assertEqual(len(query.query_parts), 0)
+ self.assertEqual(len(query.user_query_parts), 2)
self.assertEqual(len(query.languages), 0)
self.assertFalse(query.specific)
@@ -20,7 +21,7 @@ class TestQuery(SearxTestCase):
query = RawTextQuery(full_query, [])
self.assertEqual(query.getFullQuery(), full_query)
- self.assertEqual(len(query.query_parts), 5)
+ self.assertEqual(len(query.query_parts), 1)
self.assertEqual(len(query.languages), 1)
self.assertIn(language, query.languages)
self.assertFalse(query.specific)
@@ -32,7 +33,7 @@ class TestQuery(SearxTestCase):
query = RawTextQuery(full_query, [])
self.assertEqual(query.getFullQuery(), full_query)
- self.assertEqual(len(query.query_parts), 5)
+ self.assertEqual(len(query.query_parts), 1)
self.assertIn('en', query.languages)
self.assertFalse(query.specific)
@@ -43,7 +44,7 @@ class TestQuery(SearxTestCase):
query = RawTextQuery(full_query, [])
self.assertEqual(query.getFullQuery(), full_query)
- self.assertEqual(len(query.query_parts), 5)
+ self.assertEqual(len(query.query_parts), 1)
self.assertIn('all', query.languages)
self.assertFalse(query.specific)
@@ -54,7 +55,7 @@ class TestQuery(SearxTestCase):
query = RawTextQuery(full_query, [])
self.assertEqual(query.getFullQuery(), full_query)
- self.assertEqual(len(query.query_parts), 5)
+ self.assertEqual(len(query.query_parts), 0)
self.assertEqual(len(query.languages), 0)
self.assertFalse(query.specific)
@@ -63,7 +64,7 @@ class TestQuery(SearxTestCase):
query = RawTextQuery(query_text, [])
self.assertEqual(query.getFullQuery(), query_text)
- self.assertEqual(len(query.query_parts), 5)
+ self.assertEqual(len(query.query_parts), 1)
self.assertEqual(query.timeout_limit, 3)
self.assertFalse(query.specific)
@@ -72,7 +73,7 @@ class TestQuery(SearxTestCase):
query = RawTextQuery(query_text, [])
self.assertEqual(query.getFullQuery(), query_text)
- self.assertEqual(len(query.query_parts), 5)
+ self.assertEqual(len(query.query_parts), 1)
self.assertEqual(query.timeout_limit, 0.35)
self.assertFalse(query.specific)
@@ -81,7 +82,7 @@ class TestQuery(SearxTestCase):
query = RawTextQuery(query_text, [])
self.assertEqual(query.getFullQuery(), query_text)
- self.assertEqual(len(query.query_parts), 5)
+ self.assertEqual(len(query.query_parts), 1)
self.assertEqual(query.timeout_limit, 3.5)
self.assertFalse(query.specific)
@@ -91,6 +92,7 @@ class TestQuery(SearxTestCase):
query = RawTextQuery(query_text, [])
self.assertEqual(query.getFullQuery(), query_text)
- self.assertEqual(len(query.query_parts), 5)
+ self.assertEqual(len(query.query_parts), 0)
+ self.assertEqual(query.getQuery(), query_text)
self.assertEqual(query.timeout_limit, None)
self.assertFalse(query.specific)