2016-02-05 01:39:53 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2014-05-02 13:22:08 +02:00
|
|
|
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_ROBOT_TESTING
|
|
|
|
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__))
|
|
|
|
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,
|
2018-06-18 17:04:41 +02:00
|
|
|
layer=PLONE_APP_DISCUSSION_ROBOT_TESTING,
|
2014-05-02 13:22:08 +02:00
|
|
|
),
|
|
|
|
])
|
|
|
|
return suite
|