testcases.py 文件源码

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

项目:testing 作者: autopilotpattern 项目源码 文件源码
def get_container_name(self, *args):
        """
        Given an incomplete container identifier, construct the name
        with the project name included. Args can be a string like 'nginx_1'
        or an iterable like ('nginx', 2). If the arg is the container ID
        then it will be returned unchanged.
        """
        if (len(args) == 1 and all(c in string.hexdigits for c in args[0])):
            return args[0]
        name = '_'.join([str(a) for a in args])

        if (name.startswith(self.project_name)
                and name.startswith('{0}_{0}_'.format(self.project_name))):
                # some projects have services with the same name
                return name
        return '{}_{}'.format(self.project_name, name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号