invoke_test.py 文件源码

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

项目:taf 作者: taf3 项目源码 文件源码
def parse_json(self):
        data = self._get_config_data()

        try:
            json_data = json.loads(data.value)  # pylint: disable=no-member
        except ValueError:
            raise InvokeError('Failed to parse JSON data')

        # simple ordered dict
        command_execution_pairs = [
            ('ab', ApacheBenchExecution),
            ('nginx', NginxExecution),
            ('netperf', NetperfExecution),
            ('iperf', IperfExecution),
        ]

        for command_type, exec_class in command_execution_pairs:
            with suppress(KeyError):
                return exec_class(json_data[command_type], self)

        raise InvokeError('No command found to parse')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号