mirror of
https://github.com/searxng/searxng.git
synced 2025-12-22 19:50:00 +00:00
[enh] py3 compatibility
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import mock
|
||||
import sys
|
||||
from searx.testing import SearxTestCase
|
||||
from searx import utils
|
||||
|
||||
if sys.version_info[0] == 3:
|
||||
unicode = str
|
||||
|
||||
|
||||
class TestUtils(SearxTestCase):
|
||||
|
||||
@@ -30,9 +34,9 @@ class TestUtils(SearxTestCase):
|
||||
self.assertEqual(utils.highlight_content(content, None), content)
|
||||
|
||||
content = 'a'
|
||||
query = 'test'
|
||||
query = b'test'
|
||||
self.assertEqual(utils.highlight_content(content, query), content)
|
||||
query = 'a test'
|
||||
query = b'a test'
|
||||
self.assertEqual(utils.highlight_content(content, query), content)
|
||||
|
||||
def test_html_to_text(self):
|
||||
|
||||
Reference in New Issue
Block a user