summaryrefslogtreecommitdiff
path: root/searx/tests/test_robot.py
blob: 1480ae8ef1a9b66d0257d2d7a9d6733bef27c1ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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