test_robot.py 635B

1234567891011121314151617181920212223
  1. # -*- coding: utf-8 -*-
  2. import os
  3. import unittest2 as unittest
  4. from plone.testing import layered
  5. from robotsuite import RobotTestSuite
  6. from searx.testing import SEARXROBOTLAYER
  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