forked from Icycoide/searxng
[mod] move searx/testing.py to the tests directory
move robot tests to tests.robot manage calls "python -m tests.robot"
This commit is contained in:
parent
065b4dab56
commit
b9c73fb697
23 changed files with 161 additions and 157 deletions
|
@ -16,7 +16,7 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
|
|||
|
||||
|
||||
from searx.engines import command as command_engine
|
||||
from searx.testing import SearxTestCase
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class TestCommandEngine(SearxTestCase):
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from collections import defaultdict
|
||||
import mock
|
||||
from searx.engines import xpath
|
||||
from searx.testing import SearxTestCase
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class TestXpathEngine(SearxTestCase):
|
||||
|
|
|
@ -5,7 +5,7 @@ from mock import patch
|
|||
import httpx
|
||||
|
||||
from searx.network.network import Network, NETWORKS, initialize
|
||||
from searx.testing import SearxTestCase
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class TestNetwork(SearxTestCase):
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
from mock import Mock
|
||||
|
||||
from searx.answerers import answerers
|
||||
from searx.testing import SearxTestCase
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class AnswererTest(SearxTestCase):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from searx.testing import SearxTestCase
|
||||
from searx import settings, engines
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class TestEnginesInit(SearxTestCase):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from searx.external_bang import get_node, resolve_bang_definition, get_bang_url, get_bang_definition_and_autocomplete
|
||||
from searx.search import SearchQuery, EngineRef
|
||||
from searx.testing import SearxTestCase
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
TEST_DB = {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from searx.testing import SearxTestCase
|
||||
from searx import plugins
|
||||
from mock import Mock
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
def get_search_mock(query, **kwargs):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from searx.preferences import (EnumStringSetting, MapSetting, MissingArgumentException, SearchLanguageSetting,
|
||||
MultipleChoiceSetting, PluginsSetting, ValidationException)
|
||||
from searx.testing import SearxTestCase
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class PluginStub:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from searx import settings
|
||||
from searx.engines import load_engines
|
||||
from searx.query import RawTextQuery
|
||||
from searx.testing import SearxTestCase
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
TEST_ENGINES = [
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from searx.results import ResultContainer
|
||||
from searx.testing import SearxTestCase
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
def fake_result(url='https://aa.bb/cc?dd=ee#ff',
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from searx.testing import SearxTestCase
|
||||
import searx.search
|
||||
from searx.search import SearchQuery, EngineRef
|
||||
from searx import settings
|
||||
import searx.search
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
SAFESEARCH = 0
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
from os.path import dirname, join, abspath
|
||||
from unittest.mock import patch
|
||||
|
||||
from searx.testing import SearxTestCase
|
||||
from searx.exceptions import SearxSettingsException
|
||||
from searx import settings_loader
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
test_dir = abspath(dirname(__file__))
|
||||
|
|
|
@ -8,8 +8,8 @@ from mock import Mock, patch
|
|||
from nose2.tools import params
|
||||
|
||||
from searx.search import SearchQuery, EngineRef, initialize
|
||||
from searx.testing import SearxTestCase
|
||||
from searx_extra import standalone_searx as sas
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class StandaloneSearx(SearxTestCase):
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
import lxml.etree
|
||||
from lxml import html
|
||||
|
||||
from searx.testing import SearxTestCase
|
||||
from searx.exceptions import SearxXPathSyntaxException, SearxEngineXPathException
|
||||
from searx import utils
|
||||
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class TestUtils(SearxTestCase):
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from searx.testing import SearxTestCase
|
||||
from searx.preferences import Preferences
|
||||
from searx.engines import engines
|
||||
|
||||
import searx.search
|
||||
from searx.search import EngineRef
|
||||
from searx.webadapter import validate_engineref_list
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
PRIVATE_ENGINE_NAME = 'general private offline'
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
import json
|
||||
from urllib.parse import ParseResult
|
||||
from mock import Mock
|
||||
from searx.testing import SearxTestCase
|
||||
from searx.search import Search
|
||||
|
||||
import searx.search.processors
|
||||
from searx.search import Search
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class ViewsTestCase(SearxTestCase):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import mock
|
||||
from searx.testing import SearxTestCase
|
||||
from searx import webutils
|
||||
from tests import SearxTestCase
|
||||
|
||||
|
||||
class TestWebUtils(SearxTestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue