testEnvHotswap.py 文件源码

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

项目:astoptool 作者: zouliuyun 项目源码 文件源码
def check_file(file):
    pattern = r'^/.*/hotswap.zip$'
    file_with_full_path = '/app/online/{}{}'.format(GAME, file)
    file_path = os.path.dirname(file_with_full_path)

    pattern_matched = (re.match(pattern, file), 'Hotswap filename should be hotswap.zip')
    with quiet():
        file_exists = (local('test -f {}'.format(file_with_full_path)).succeeded, '{} does NOT exists on FTP, please check'.format(file))
        md5_exists = (local('test -f {}/md5.txt'.format(file_path)).succeeded, 'md5.txt does NOT exists on FTP, please check')

    for each_check in [pattern_matched, file_exists, md5_exists]:
        if each_check[0]:
            pass
        else:
            raise Exception(each_check[1])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号