From 8769b7c6d6d62b961d62b9454bd12f69fba298c8 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 5 Mar 2025 17:29:20 +0100 Subject: [refactor] typification of SearXNG (MainResult) / result items (part 2) The class ReslutContainer has been revised, it can now handle the typed Result items of classes: - MainResult - LegacyResult (a dict wrapper for backward compatibility) Due to the now complete typing of theses three clases, instead of the *getitem* accesses, the fields can now be accessed directly via attributes (which is also supported by the IDE). Signed-off-by: Markus Heiser --- tests/unit/test_webapp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/unit/test_webapp.py') diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py index e8f4fcdcd..35a41302c 100644 --- a/tests/unit/test_webapp.py +++ b/tests/unit/test_webapp.py @@ -148,11 +148,10 @@ class ViewsTestCase(SearxTestCase): # pylint: disable=too-many-public-methods def test_search_csv(self): result = self.client.post('/search', data={'q': 'test', 'format': 'csv'}) - self.assertEqual( b'title,url,content,host,engine,score,type\r\n' - b'First Test,http://first.test.xyz,first test content,first.test.xyz,startpage,,result\r\n' # noqa - b'Second Test,http://second.test.xyz,second test content,second.test.xyz,youtube,,result\r\n', # noqa + + b'First Test,http://first.test.xyz,first test content,first.test.xyz,startpage,0,result\r\n' + + b'Second Test,http://second.test.xyz,second test content,second.test.xyz,youtube,0,result\r\n', result.data, ) -- cgit v1.2.3