def parse(d):
"""Check a dict keyed by the related calls against their expected values
Dict format:
Key:
tuple:
[0] - module from which the command is called
[1] - command which you are calling
[*] - index=x, where x is the index you wish
[*] - end=x, where x is the end of the range to return
[*] - all other args in the order the command is supposed
to receive it; keyed arguments are not supported
Value:
The expected return value
"""
if d == {} or d is None:
return True
if len(d) == 1:
return process(list(d.items())[0])
from multiprocessing.pool import ThreadPool
p = list(d.items())
r = ThreadPool().map(process, p)
return not (False in r)
评论列表
文章目录