Commit 4f7ff125 authored by Boxiang Sun's avatar Boxiang Sun

Add SlapOSDocTestSuite class to run erp5-doc tests

This test suite is for run the tests in the erp5-doc repository.
Put it in this repository is because the testpages in the
erp5-doc/erp5_slapos_tutorial need slapos-master recipe to configure the
erp5 instance.
parent b60ce7e5
......@@ -126,3 +126,26 @@ class SlapOSCloud(SavedTestSuite, ProjectTestSuite):
status_dict['test_count'] = int(group_dict['total'])
status_dict['skip_count'] = int(group_dict['expected_failure'])
return status_dict
class SlapOSDocTestSuite(SlapOSCloud):
_product_list = []
_saved_test_id = 'erp5_slapos_tutorial:testFunctionalStandaloneSlapOSTutorial'
_bt_list = ['erp5_slapos_tutorial']
def getTestList(self):
test_list = []
path = sys.path[0]
erp5_doc_path = sys.path[1]
component_re = re.compile(".*/([^/]+)/TestTemplateItem/portal_components"
"/test\.[^.]+\.([^.]+).py$")
for test_path in (
glob('%s/bt5/*/TestTemplateItem/portal_components/test.*.test*.py' % erp5_doc_path)):
component_re_match = component_re.match(test_path)
if component_re_match is not None:
test_case = "%s:%s" % (component_re_match.group(1),
component_re_match.group(2))
else:
test_case = test_path.split(os.sep)[-1][:-3] # remove .py
test_list.append(test_case)
return test_list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment