diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2025-08-21 17:57:58 +0200 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2025-09-01 14:51:15 +0200 |
| commit | 9ac9c8c4f50acd801bfc39107c94d17ee9bee72b (patch) | |
| tree | 0545c9e9ae37462cfd64b5e85620453ffe2981c8 /tests | |
| parent | b8085d27aca35b3c60ef50bf0683018d6a6b51b3 (diff) | |
[mod] typification of SearXNG: add new result type Code
This patch adds a new result type: Code
- Python class: searx/result_types/code.py
- Jinja template: searx/templates/simple/result_templates/code.html
- CSS (less) client/simple/src/less/result_types/code.less
Signed-of-by: Markus Heiser <markus.heiser@darmarIT.de>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_engine_github_code.py | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/tests/unit/test_engine_github_code.py b/tests/unit/test_engine_github_code.py index d10081f28..13a560713 100644 --- a/tests/unit/test_engine_github_code.py +++ b/tests/unit/test_engine_github_code.py @@ -142,29 +142,26 @@ class GithubCodeTests(SearxTestCase): results = self.ghc.response(response) expected_results = EngineResults() expected_results.add( - expected_results.types.LegacyResult( - **{ - 'url': "https://github.com/folke/dot/blob/3140f4f5720c3cc6b5034c624eb7706f8533a82c/TODO.md", - 'title': "folke/dot · TODO.md", - 'content': "☕️ My Dot Files", - 'repository': "https://github.com/folke/dot", - 'codelines': [ - (1, "- [x] windows picker"), - (2, "- [x] toggle cwd / root (LazyVim)"), - (3, "- [x] dynamic workspace symbol"), - (4, "- [x] smart stops working after custom"), - (5, "- [x] edit in empty buffer"), - (6, "- [x] support toggling line nr for preview"), - ], - 'hl_lines': {2, 5, 6}, - 'code_language': "markdown", - 'template': 'code.html', - 'strip_whitespace': False, - 'strip_new_lines': True, - 'parsed_url': urlparse( - "https://github.com/folke/dot/blob/3140f4f5720c3cc6b5034c624eb7706f8533a82c/TODO.md" - ), - } + expected_results.types.Code( + url="https://github.com/folke/dot/blob/3140f4f5720c3cc6b5034c624eb7706f8533a82c/TODO.md", + title="folke/dot · TODO.md", + content="☕️ My Dot Files", + repository="https://github.com/folke/dot", + codelines=[ + (1, "- [x] windows picker"), + (2, "- [x] toggle cwd / root (LazyVim)"), + (3, "- [x] dynamic workspace symbol"), + (4, "- [x] smart stops working after custom"), + (5, "- [x] edit in empty buffer"), + (6, "- [x] support toggling line nr for preview"), + ], + hl_lines={2, 5, 6}, + code_language="markdown", + strip_whitespace=False, + strip_new_lines=True, + parsed_url=urlparse( + "https://github.com/folke/dot/blob/3140f4f5720c3cc6b5034c624eb7706f8533a82c/TODO.md" + ), ) ) self.assertEqual(results, expected_results) |