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
评论列表
文章目录