• python生成url测试用例


    generate_url.py

    #!/usr/bin/env python
    
    import random
    import os, sys
    
    channels = [ 
        "BTV2", "BTV3", "BTV4", "BTV5", "BTV6", "BTV7", "BTV8", "BTV9", 
        "BTVWorld", "CCTV12", "CCTV2", "CCTV3", "CCTV5", "CCTV6", "CCTV6World", "CCTV7", 
        "CCTV8", "CCTV9World", "CCTVA", "CCTVChild", "CCTVE", "CCTVEN", "CCTVF", "CCTVFYYY", 
        "CCTVHJJC", "CCTVMusic", "CCTVNEWS", "CCTVR", "CETV1", "CETV3", "ChongQingTV", "ChongQingWorld", 
        "GZChild", "GZEnglish", "GZFinance", "GZJingSai", "GZMovie", "GanSuTV", "GuangXiTV", "GuiZhouTV", 
        ]
    
    host = '10.160.1.21'
    date = '2014/10/31'
    bitrates = ['800000']
    ts_path = '/opt/online01/stream'
    
    with open('/opt/urllist', 'wt') as f:
        for i in xrange(1, 2**16):
            channel = random.choice(channels)
            bitrate = random.choice(bitrates)
            path = ''.join([ts_path, '/', bitrate, '/', channel, '/', date])
            filenames = os.listdir(path)
            filename = random.choice(filenames)
            ts_url = ''.join(['http://', host, '/', 'online01/stream/', bitrate, '/', channel, '/', date, '/', filename, '
    '])
            f.write(ts_url) 
    
    
    
    
  • 相关阅读:
    【对拍√】
    hdu5791 TWO
    luogu P1220 关路灯
    【NOI2001】食物链
    【HAOI2016】食物链
    luogu P1006 传纸条
    可持久化平衡树
    可持久化并查集
    线段树合并(【POI2011】ROT-Tree Rotations)
    可持久化数组
  • 原文地址:https://www.cnblogs.com/liujitao79/p/4064883.html
Copyright © 2020-2023  润新知