test_task_samples.py 文件源码

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

项目:xrally-docker 作者: xrally 项目源码 文件源码
def test_context_samples_found(self):
        all_plugins = context.Context.get_all()
        context_samples_path = os.path.join(self.samples_path, "contexts")
        for p in all_plugins:
            if not inspect.getfile(p).startswith(
               os.path.dirname(xrally_docker.__file__)):
                # except contexts which belongs to tests module
                continue
            elif p.get_name() == "users":
                # users is a dummy context for doing nothing
                continue
            file_name = p.get_name().replace("_", "-")
            file_path = os.path.join(context_samples_path, file_name)
            if not os.path.exists("%s.json" % file_path):
                self.fail(("There is no json sample file of %s,"
                           "plugin location: %s.json" %
                           (p.get_name(), file_path)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号