2022-05-02 00:39:34 +02:00
|
|
|
from ..testing import PLONE_APP_DISCUSSION_ROBOT_TESTING
|
2014-05-02 13:22:08 +02:00
|
|
|
from plone.app.testing import ROBOT_TEST_LEVEL
|
|
|
|
from plone.testing import layered
|
2015-05-03 08:16:39 +02:00
|
|
|
|
2014-05-02 13:22:08 +02:00
|
|
|
import os
|
|
|
|
import robotsuite
|
2015-05-03 08:16:39 +02:00
|
|
|
import unittest
|
2014-05-02 13:22:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_suite():
|
|
|
|
suite = unittest.TestSuite()
|
|
|
|
current_dir = os.path.abspath(os.path.dirname(__file__))
|
2022-05-01 23:14:09 +02:00
|
|
|
robot_dir = os.path.join(current_dir, "robot")
|
2014-05-02 13:22:08 +02:00
|
|
|
robot_tests = [
|
2022-05-01 23:14:09 +02:00
|
|
|
os.path.join("robot", doc)
|
|
|
|
for doc in os.listdir(robot_dir)
|
|
|
|
if doc.endswith(".robot") and doc.startswith("test_")
|
2014-05-02 13:22:08 +02:00
|
|
|
]
|
|
|
|
for robot_test in robot_tests:
|
|
|
|
robottestsuite = robotsuite.RobotTestSuite(robot_test)
|
|
|
|
robottestsuite.level = ROBOT_TEST_LEVEL
|
2022-05-01 23:14:09 +02:00
|
|
|
suite.addTests(
|
|
|
|
[
|
|
|
|
layered(
|
|
|
|
robottestsuite,
|
|
|
|
layer=PLONE_APP_DISCUSSION_ROBOT_TESTING,
|
|
|
|
),
|
|
|
|
]
|
|
|
|
)
|
2014-05-02 13:22:08 +02:00
|
|
|
return suite
|