def _add(self, testcases):
""" Add given test cases to the test run """
# Short info about the action
identifiers = [testcase.identifier for testcase in testcases]
log.info("Adding {0} to {1}".format(
listed(identifiers, "testcase", max=3),
self._object.identifier))
# Prepare data and push
data = [testcase.id for testcase in testcases]
log.data(pretty(data))
try:
self._server.TestRun.add_cases(self.id, data)
# Handle duplicate entry errors by adding test cases one by one
except xmlrpclib.Fault as error:
if "Duplicate entry" not in str(error):
raise
log.warn(error)
for id in data:
try:
self._server.TestRun.add_cases(self.id, id)
except xmlrpclib.Fault:
pass
# RunCaseRuns will need update ---> erase current data
self._object.caseruns._init()
评论列表
文章目录