test_robot.py 636 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. from plone.testing import layered
  3. from robotsuite import RobotTestSuite
  4. from searx.testing import SEARXROBOTLAYER
  5. import os
  6. import unittest2 as unittest
  7. def test_suite():
  8. suite = unittest.TestSuite()
  9. current_dir = os.path.abspath(os.path.dirname(__file__))
  10. robot_dir = os.path.join(current_dir, 'robot')
  11. tests = [
  12. os.path.join('robot', f) for f in
  13. os.listdir(robot_dir) if f.endswith('.robot') and
  14. f.startswith('test_')
  15. ]
  16. for test in tests:
  17. suite.addTests([
  18. layered(RobotTestSuite(test), layer=SEARXROBOTLAYER),
  19. ])
  20. return suite