-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_robot.py
31 lines (28 loc) · 922 Bytes
/
test_robot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
from plone.app.testing import ROBOT_TEST_LEVEL
from plone.testing import layered
from library.policy.testing import LIBRARY_POLICY_ACCEPTANCE_TESTING # noqa
import os
import robotsuite
import unittest
def test_suite():
suite = unittest.TestSuite()
current_dir = os.path.abspath(os.path.dirname(__file__))
robot_dir = os.path.join(current_dir, "robot")
robot_tests = [
os.path.join("robot", doc)
for doc in os.listdir(robot_dir)
if doc.endswith(".robot") and doc.startswith("test_")
]
for robot_test in robot_tests:
robottestsuite = robotsuite.RobotTestSuite(robot_test)
robottestsuite.level = ROBOT_TEST_LEVEL
suite.addTests(
[
layered(
robottestsuite,
layer=LIBRARY_POLICY_ACCEPTANCE_TESTING,
),
]
)
return suite