test_netmiko_grep.py 文件源码

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

项目:netmiko_tools 作者: ktbyers 项目源码 文件源码
def test_use_cache():
    """With cached files this should come back in under a second"""
    # Generate cached files
    cmd_list = [NETMIKO_GREP] + ['interface', 'all']
    subprocess_handler(cmd_list)
    cmd_list = [NETMIKO_GREP] + ['--use-cache', '--display-runtime', 'interface', 'all']
    (output, std_err) = subprocess_handler(cmd_list)
    match = re.search(r"Total time: (0:.*)", output)
    time = match.group(1)
    _, _, seconds = time.split(":")
    seconds = float(seconds)
    assert seconds <= 1
    assert 'pynet_rtr1.txt:interface FastEthernet0' in output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号