mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 18:42:33 +02:00
tests and robot tests framework, build overhaul
This commit is contained in:
parent
348187cff9
commit
e740c8a8ea
17 changed files with 732 additions and 5 deletions
0
searx/tests/__init__.py
Normal file
0
searx/tests/__init__.py
Normal file
0
searx/tests/robot/__init__.py
Normal file
0
searx/tests/robot/__init__.py
Normal file
11
searx/tests/robot/test_basic.robot
Normal file
11
searx/tests/robot/test_basic.robot
Normal file
|
@ -0,0 +1,11 @@
|
|||
*** Settings ***
|
||||
Library Selenium2Library timeout=10 implicit_wait=0.5
|
||||
Test Setup Open Browser http://localhost:11111/
|
||||
Test Teardown Close All Browsers
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
Front page
|
||||
Page Should Contain about
|
||||
Page Should Contain preferences
|
||||
|
24
searx/tests/test_robot.py
Normal file
24
searx/tests/test_robot.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from plone.testing import layered
|
||||
from robotsuite import RobotTestSuite
|
||||
from searx.testing import SEARXROBOTLAYER
|
||||
|
||||
import os
|
||||
import unittest2 as unittest
|
||||
|
||||
|
||||
def test_suite():
|
||||
suite = unittest.TestSuite()
|
||||
current_dir = os.path.abspath(os.path.dirname(__file__))
|
||||
robot_dir = os.path.join(current_dir, 'robot')
|
||||
tests = [
|
||||
os.path.join('robot', f) for f in
|
||||
os.listdir(robot_dir) if f.endswith('.robot') and
|
||||
f.startswith('test_')
|
||||
]
|
||||
for test in tests:
|
||||
suite.addTests([
|
||||
layered(RobotTestSuite(test), layer=SEARXROBOTLAYER),
|
||||
])
|
||||
return suite
|
10
searx/tests/test_unit.py
Normal file
10
searx/tests/test_unit.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from searx.testing import SearxTestCase
|
||||
|
||||
|
||||
class UnitTestCase(SearxTestCase):
|
||||
|
||||
def test_flask(self):
|
||||
import flask
|
||||
self.assertIn('Flask', dir(flask))
|
Loading…
Add table
Add a link
Reference in a new issue