containers.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:Kiwi 作者: kiwitcms 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号